Skip to content
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

APP-3229: API changes for viam agent. #398

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,132 changes: 1,132 additions & 0 deletions app/agent/v1/agent.pb.go

Large diffs are not rendered by default.

395 changes: 395 additions & 0 deletions app/agent/v1/agent.pb.gw.go

Large diffs are not rendered by default.

233 changes: 233 additions & 0 deletions app/agent/v1/agent_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions component/audioinput/v1/audioinput.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions component/board/v1/board.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions component/encoder/v1/encoder.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions component/gantry/v1/gantry.pb.gw.go
10 changes: 5 additions & 5 deletions component/gripper/v1/gripper.pb.gw.go
14 changes: 7 additions & 7 deletions component/movementsensor/v1/movementsensor.pb.gw.go
10 changes: 5 additions & 5 deletions component/posetracker/v1/pose_tracker.pb.gw.go
10 changes: 5 additions & 5 deletions component/powersensor/v1/powersensor.pb.gw.go
14 changes: 7 additions & 7 deletions component/sensor/v1/sensor.pb.gw.go
320 changes: 320 additions & 0 deletions gen/js/app/agent/v1/agent_grpc_web_pb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,320 @@
/**
* @fileoverview gRPC-Web generated client stub for viam.app.agent.v1
* @enhanceable
* @public
*/

// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
// protoc-gen-grpc-web v1.4.2
// protoc v0.0.0
// source: app/agent/v1/agent.proto


/* eslint-disable */
// @ts-nocheck



const grpc = {};
grpc.web = require('grpc-web');


var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js')

var tagger_v1_tagger_pb = require('../../../tagger/v1/tagger_pb.js')
const proto = {};
proto.viam = {};
proto.viam.app = {};
proto.viam.app.agent = {};
proto.viam.app.agent.v1 = require('./agent_pb.js');

/**
* @param {string} hostname
* @param {?Object} credentials
* @param {?grpc.web.ClientOptions} options
* @constructor
* @struct
* @final
*/
proto.viam.app.agent.v1.AgentAppServiceClient =
function(hostname, credentials, options) {
if (!options) options = {};
options.format = 'text';

/**
* @private @const {!grpc.web.GrpcWebClientBase} The client
*/
this.client_ = new grpc.web.GrpcWebClientBase(options);

/**
* @private @const {string} The hostname
*/
this.hostname_ = hostname.replace(/\/+$/, '');

};


/**
* @param {string} hostname
* @param {?Object} credentials
* @param {?grpc.web.ClientOptions} options
* @constructor
* @struct
* @final
*/
proto.viam.app.agent.v1.AgentAppServicePromiseClient =
function(hostname, credentials, options) {
if (!options) options = {};
options.format = 'text';

/**
* @private @const {!grpc.web.GrpcWebClientBase} The client
*/
this.client_ = new grpc.web.GrpcWebClientBase(options);

/**
* @private @const {string} The hostname
*/
this.hostname_ = hostname.replace(/\/+$/, '');

};


/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.viam.app.agent.v1.GetAgentConfigRequest,
* !proto.viam.app.agent.v1.GetAgentConfigResponse>}
*/
const methodDescriptor_AgentAppService_GetAgentConfig = new grpc.web.MethodDescriptor(
'/viam.app.agent.v1.AgentAppService/GetAgentConfig',
grpc.web.MethodType.UNARY,
proto.viam.app.agent.v1.GetAgentConfigRequest,
proto.viam.app.agent.v1.GetAgentConfigResponse,
/**
* @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.viam.app.agent.v1.GetAgentConfigResponse.deserializeBinary
);


/**
* @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
* @param {function(?grpc.web.RpcError, ?proto.viam.app.agent.v1.GetAgentConfigResponse)}
* callback The callback function(error, response)
* @return {!grpc.web.ClientReadableStream<!proto.viam.app.agent.v1.GetAgentConfigResponse>|undefined}
* The XHR Node Readable Stream
*/
proto.viam.app.agent.v1.AgentAppServiceClient.prototype.getAgentConfig =
function(request, metadata, callback) {
return this.client_.rpcCall(this.hostname_ +
'/viam.app.agent.v1.AgentAppService/GetAgentConfig',
request,
metadata || {},
methodDescriptor_AgentAppService_GetAgentConfig,
callback);
};


/**
* @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} request The
* request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!Promise<!proto.viam.app.agent.v1.GetAgentConfigResponse>}
* Promise that resolves to the response
*/
proto.viam.app.agent.v1.AgentAppServicePromiseClient.prototype.getAgentConfig =
function(request, metadata) {
return this.client_.unaryCall(this.hostname_ +
'/viam.app.agent.v1.AgentAppService/GetAgentConfig',
request,
metadata || {},
methodDescriptor_AgentAppService_GetAgentConfig);
};


/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.viam.app.agent.v1.UpdateAgentConfigRequest,
* !proto.viam.app.agent.v1.UpdateAgentConfigResponse>}
*/
const methodDescriptor_AgentAppService_UpdateAgentConfig = new grpc.web.MethodDescriptor(
'/viam.app.agent.v1.AgentAppService/UpdateAgentConfig',
grpc.web.MethodType.UNARY,
proto.viam.app.agent.v1.UpdateAgentConfigRequest,
proto.viam.app.agent.v1.UpdateAgentConfigResponse,
/**
* @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.viam.app.agent.v1.UpdateAgentConfigResponse.deserializeBinary
);


/**
* @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
* @param {function(?grpc.web.RpcError, ?proto.viam.app.agent.v1.UpdateAgentConfigResponse)}
* callback The callback function(error, response)
* @return {!grpc.web.ClientReadableStream<!proto.viam.app.agent.v1.UpdateAgentConfigResponse>|undefined}
* The XHR Node Readable Stream
*/
proto.viam.app.agent.v1.AgentAppServiceClient.prototype.updateAgentConfig =
function(request, metadata, callback) {
return this.client_.rpcCall(this.hostname_ +
'/viam.app.agent.v1.AgentAppService/UpdateAgentConfig',
request,
metadata || {},
methodDescriptor_AgentAppService_UpdateAgentConfig,
callback);
};


/**
* @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} request The
* request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!Promise<!proto.viam.app.agent.v1.UpdateAgentConfigResponse>}
* Promise that resolves to the response
*/
proto.viam.app.agent.v1.AgentAppServicePromiseClient.prototype.updateAgentConfig =
function(request, metadata) {
return this.client_.unaryCall(this.hostname_ +
'/viam.app.agent.v1.AgentAppService/UpdateAgentConfig',
request,
metadata || {},
methodDescriptor_AgentAppService_UpdateAgentConfig);
};


/**
* @param {string} hostname
* @param {?Object} credentials
* @param {?grpc.web.ClientOptions} options
* @constructor
* @struct
* @final
*/
proto.viam.app.agent.v1.AgentDeviceServiceClient =
function(hostname, credentials, options) {
if (!options) options = {};
options.format = 'text';

/**
* @private @const {!grpc.web.GrpcWebClientBase} The client
*/
this.client_ = new grpc.web.GrpcWebClientBase(options);

/**
* @private @const {string} The hostname
*/
this.hostname_ = hostname.replace(/\/+$/, '');

};


/**
* @param {string} hostname
* @param {?Object} credentials
* @param {?grpc.web.ClientOptions} options
* @constructor
* @struct
* @final
*/
proto.viam.app.agent.v1.AgentDeviceServicePromiseClient =
function(hostname, credentials, options) {
if (!options) options = {};
options.format = 'text';

/**
* @private @const {!grpc.web.GrpcWebClientBase} The client
*/
this.client_ = new grpc.web.GrpcWebClientBase(options);

/**
* @private @const {string} The hostname
*/
this.hostname_ = hostname.replace(/\/+$/, '');

};


/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.viam.app.agent.v1.DeviceAgentConfigRequest,
* !proto.viam.app.agent.v1.DeviceAgentConfigResponse>}
*/
const methodDescriptor_AgentDeviceService_DeviceAgentConfig = new grpc.web.MethodDescriptor(
'/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig',
grpc.web.MethodType.UNARY,
proto.viam.app.agent.v1.DeviceAgentConfigRequest,
proto.viam.app.agent.v1.DeviceAgentConfigResponse,
/**
* @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.viam.app.agent.v1.DeviceAgentConfigResponse.deserializeBinary
);


/**
* @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
* @param {function(?grpc.web.RpcError, ?proto.viam.app.agent.v1.DeviceAgentConfigResponse)}
* callback The callback function(error, response)
* @return {!grpc.web.ClientReadableStream<!proto.viam.app.agent.v1.DeviceAgentConfigResponse>|undefined}
* The XHR Node Readable Stream
*/
proto.viam.app.agent.v1.AgentDeviceServiceClient.prototype.deviceAgentConfig =
function(request, metadata, callback) {
return this.client_.rpcCall(this.hostname_ +
'/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig',
request,
metadata || {},
methodDescriptor_AgentDeviceService_DeviceAgentConfig,
callback);
};


/**
* @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} request The
* request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!Promise<!proto.viam.app.agent.v1.DeviceAgentConfigResponse>}
* Promise that resolves to the response
*/
proto.viam.app.agent.v1.AgentDeviceServicePromiseClient.prototype.deviceAgentConfig =
function(request, metadata) {
return this.client_.unaryCall(this.hostname_ +
'/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig',
request,
metadata || {},
methodDescriptor_AgentDeviceService_DeviceAgentConfig);
};


module.exports = proto.viam.app.agent.v1;

310 changes: 310 additions & 0 deletions gen/js/app/agent/v1/agent_pb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
// package: viam.app.agent.v1
// file: app/agent/v1/agent.proto

import * as jspb from "google-protobuf";
import * as google_protobuf_duration_pb from "google-protobuf/google/protobuf/duration_pb";
import * as tagger_v1_tagger_pb from "../../../tagger/v1/tagger_pb";

export class GetAgentConfigRequest extends jspb.Message {
getId(): string;
setId(value: string): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetAgentConfigRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetAgentConfigRequest): GetAgentConfigRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetAgentConfigRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetAgentConfigRequest;
static deserializeBinaryFromReader(message: GetAgentConfigRequest, reader: jspb.BinaryReader): GetAgentConfigRequest;
}

export namespace GetAgentConfigRequest {
export type AsObject = {
id: string,
}
}

export class GetAgentConfigResponse extends jspb.Message {
hasAgentConfig(): boolean;
clearAgentConfig(): void;
getAgentConfig(): AppAgentConfig | undefined;
setAgentConfig(value?: AppAgentConfig): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetAgentConfigResponse.AsObject;
static toObject(includeInstance: boolean, msg: GetAgentConfigResponse): GetAgentConfigResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetAgentConfigResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetAgentConfigResponse;
static deserializeBinaryFromReader(message: GetAgentConfigResponse, reader: jspb.BinaryReader): GetAgentConfigResponse;
}

export namespace GetAgentConfigResponse {
export type AsObject = {
agentConfig?: AppAgentConfig.AsObject,
}
}

export class UpdateAgentConfigRequest extends jspb.Message {
getId(): string;
setId(value: string): void;

hasAgentConfig(): boolean;
clearAgentConfig(): void;
getAgentConfig(): AppAgentConfig | undefined;
setAgentConfig(value?: AppAgentConfig): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UpdateAgentConfigRequest.AsObject;
static toObject(includeInstance: boolean, msg: UpdateAgentConfigRequest): UpdateAgentConfigRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: UpdateAgentConfigRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UpdateAgentConfigRequest;
static deserializeBinaryFromReader(message: UpdateAgentConfigRequest, reader: jspb.BinaryReader): UpdateAgentConfigRequest;
}

export namespace UpdateAgentConfigRequest {
export type AsObject = {
id: string,
agentConfig?: AppAgentConfig.AsObject,
}
}

export class UpdateAgentConfigResponse extends jspb.Message {
hasAgentConfig(): boolean;
clearAgentConfig(): void;
getAgentConfig(): AppAgentConfig | undefined;
setAgentConfig(value?: AppAgentConfig): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UpdateAgentConfigResponse.AsObject;
static toObject(includeInstance: boolean, msg: UpdateAgentConfigResponse): UpdateAgentConfigResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: UpdateAgentConfigResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UpdateAgentConfigResponse;
static deserializeBinaryFromReader(message: UpdateAgentConfigResponse, reader: jspb.BinaryReader): UpdateAgentConfigResponse;
}

export namespace UpdateAgentConfigResponse {
export type AsObject = {
agentConfig?: AppAgentConfig.AsObject,
}
}

export class AppAgentConfig extends jspb.Message {
getSubsystemConfigsMap(): jspb.Map<string, AppSubsystemConfig>;
clearSubsystemConfigsMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AppAgentConfig.AsObject;
static toObject(includeInstance: boolean, msg: AppAgentConfig): AppAgentConfig.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: AppAgentConfig, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): AppAgentConfig;
static deserializeBinaryFromReader(message: AppAgentConfig, reader: jspb.BinaryReader): AppAgentConfig;
}

export namespace AppAgentConfig {
export type AsObject = {
subsystemConfigsMap: Array<[string, AppSubsystemConfig.AsObject]>,
}
}

export class AppSubsystemConfig extends jspb.Message {
getReleaseChannel(): string;
setReleaseChannel(value: string): void;

getPinVersion(): string;
setPinVersion(value: string): void;

getPinUrl(): string;
setPinUrl(value: string): void;

getDisableSubsystem(): boolean;
setDisableSubsystem(value: boolean): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AppSubsystemConfig.AsObject;
static toObject(includeInstance: boolean, msg: AppSubsystemConfig): AppSubsystemConfig.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: AppSubsystemConfig, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): AppSubsystemConfig;
static deserializeBinaryFromReader(message: AppSubsystemConfig, reader: jspb.BinaryReader): AppSubsystemConfig;
}

export namespace AppSubsystemConfig {
export type AsObject = {
releaseChannel: string,
pinVersion: string,
pinUrl: string,
disableSubsystem: boolean,
}
}

export class DeviceAgentConfigRequest extends jspb.Message {
getId(): string;
setId(value: string): void;

hasHostInfo(): boolean;
clearHostInfo(): void;
getHostInfo(): HostInfo | undefined;
setHostInfo(value?: HostInfo): void;

getSubsystemVersionsMap(): jspb.Map<string, string>;
clearSubsystemVersionsMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DeviceAgentConfigRequest.AsObject;
static toObject(includeInstance: boolean, msg: DeviceAgentConfigRequest): DeviceAgentConfigRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DeviceAgentConfigRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DeviceAgentConfigRequest;
static deserializeBinaryFromReader(message: DeviceAgentConfigRequest, reader: jspb.BinaryReader): DeviceAgentConfigRequest;
}

export namespace DeviceAgentConfigRequest {
export type AsObject = {
id: string,
hostInfo?: HostInfo.AsObject,
subsystemVersionsMap: Array<[string, string]>,
}
}

export class DeviceAgentConfigResponse extends jspb.Message {
getSubsystemConfigsMap(): jspb.Map<string, DeviceSubsystemConfig>;
clearSubsystemConfigsMap(): void;
hasCheckInterval(): boolean;
clearCheckInterval(): void;
getCheckInterval(): google_protobuf_duration_pb.Duration | undefined;
setCheckInterval(value?: google_protobuf_duration_pb.Duration): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DeviceAgentConfigResponse.AsObject;
static toObject(includeInstance: boolean, msg: DeviceAgentConfigResponse): DeviceAgentConfigResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DeviceAgentConfigResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DeviceAgentConfigResponse;
static deserializeBinaryFromReader(message: DeviceAgentConfigResponse, reader: jspb.BinaryReader): DeviceAgentConfigResponse;
}

export namespace DeviceAgentConfigResponse {
export type AsObject = {
subsystemConfigsMap: Array<[string, DeviceSubsystemConfig.AsObject]>,
checkInterval?: google_protobuf_duration_pb.Duration.AsObject,
}
}

export class DeviceSubsystemConfig extends jspb.Message {
hasUpdateInfo(): boolean;
clearUpdateInfo(): void;
getUpdateInfo(): SubsystemUpdateInfo | undefined;
setUpdateInfo(value?: SubsystemUpdateInfo): void;

getDisable(): boolean;
setDisable(value: boolean): void;

getForceRestart(): boolean;
setForceRestart(value: boolean): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DeviceSubsystemConfig.AsObject;
static toObject(includeInstance: boolean, msg: DeviceSubsystemConfig): DeviceSubsystemConfig.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DeviceSubsystemConfig, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DeviceSubsystemConfig;
static deserializeBinaryFromReader(message: DeviceSubsystemConfig, reader: jspb.BinaryReader): DeviceSubsystemConfig;
}

export namespace DeviceSubsystemConfig {
export type AsObject = {
updateInfo?: SubsystemUpdateInfo.AsObject,
disable: boolean,
forceRestart: boolean,
}
}

export class HostInfo extends jspb.Message {
getPlatform(): string;
setPlatform(value: string): void;

getDistro(): string;
setDistro(value: string): void;

clearTagsList(): void;
getTagsList(): Array<string>;
setTagsList(value: Array<string>): void;
addTags(value: string, index?: number): string;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): HostInfo.AsObject;
static toObject(includeInstance: boolean, msg: HostInfo): HostInfo.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: HostInfo, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): HostInfo;
static deserializeBinaryFromReader(message: HostInfo, reader: jspb.BinaryReader): HostInfo;
}

export namespace HostInfo {
export type AsObject = {
platform: string,
distro: string,
tagsList: Array<string>,
}
}

export class SubsystemUpdateInfo extends jspb.Message {
getFilename(): string;
setFilename(value: string): void;

getUrl(): string;
setUrl(value: string): void;

getVersion(): string;
setVersion(value: string): void;

getSha256(): Uint8Array | string;
getSha256_asU8(): Uint8Array;
getSha256_asB64(): string;
setSha256(value: Uint8Array | string): void;

getFormat(): PackageFormatMap[keyof PackageFormatMap];
setFormat(value: PackageFormatMap[keyof PackageFormatMap]): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): SubsystemUpdateInfo.AsObject;
static toObject(includeInstance: boolean, msg: SubsystemUpdateInfo): SubsystemUpdateInfo.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: SubsystemUpdateInfo, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): SubsystemUpdateInfo;
static deserializeBinaryFromReader(message: SubsystemUpdateInfo, reader: jspb.BinaryReader): SubsystemUpdateInfo;
}

export namespace SubsystemUpdateInfo {
export type AsObject = {
filename: string,
url: string,
version: string,
sha256: Uint8Array | string,
format: PackageFormatMap[keyof PackageFormatMap],
}
}

export interface PackageFormatMap {
PACKAGE_FORMAT_UNSPECIFIED: 0;
PACKAGE_FORMAT_RAW: 1;
PACKAGE_FORMAT_XZ: 2;
PACKAGE_FORMAT_EXECUTABLE: 3;
PACKAGE_FORMAT_XZ_EXECUTABLE: 4;
}

export const PackageFormat: PackageFormatMap;

2,341 changes: 2,341 additions & 0 deletions gen/js/app/agent/v1/agent_pb.js

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions gen/js/app/agent/v1/agent_pb_service.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// package: viam.app.agent.v1
// file: app/agent/v1/agent.proto

import * as app_agent_v1_agent_pb from "../../../app/agent/v1/agent_pb";
import {grpc} from "@improbable-eng/grpc-web";

type AgentAppServiceGetAgentConfig = {
readonly methodName: string;
readonly service: typeof AgentAppService;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof app_agent_v1_agent_pb.GetAgentConfigRequest;
readonly responseType: typeof app_agent_v1_agent_pb.GetAgentConfigResponse;
};

type AgentAppServiceUpdateAgentConfig = {
readonly methodName: string;
readonly service: typeof AgentAppService;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof app_agent_v1_agent_pb.UpdateAgentConfigRequest;
readonly responseType: typeof app_agent_v1_agent_pb.UpdateAgentConfigResponse;
};

export class AgentAppService {
static readonly serviceName: string;
static readonly GetAgentConfig: AgentAppServiceGetAgentConfig;
static readonly UpdateAgentConfig: AgentAppServiceUpdateAgentConfig;
}

type AgentDeviceServiceDeviceAgentConfig = {
readonly methodName: string;
readonly service: typeof AgentDeviceService;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof app_agent_v1_agent_pb.DeviceAgentConfigRequest;
readonly responseType: typeof app_agent_v1_agent_pb.DeviceAgentConfigResponse;
};

export class AgentDeviceService {
static readonly serviceName: string;
static readonly DeviceAgentConfig: AgentDeviceServiceDeviceAgentConfig;
}

export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
export type Status = { details: string, code: number; metadata: grpc.Metadata }

interface UnaryResponse {
cancel(): void;
}
interface ResponseStream<T> {
cancel(): void;
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
}
interface RequestStream<T> {
write(message: T): RequestStream<T>;
end(): void;
cancel(): void;
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
}
interface BidirectionalStream<ReqT, ResT> {
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
end(): void;
cancel(): void;
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
}

export class AgentAppServiceClient {
readonly serviceHost: string;

constructor(serviceHost: string, options?: grpc.RpcOptions);
getAgentConfig(
requestMessage: app_agent_v1_agent_pb.GetAgentConfigRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.GetAgentConfigResponse|null) => void
): UnaryResponse;
getAgentConfig(
requestMessage: app_agent_v1_agent_pb.GetAgentConfigRequest,
callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.GetAgentConfigResponse|null) => void
): UnaryResponse;
updateAgentConfig(
requestMessage: app_agent_v1_agent_pb.UpdateAgentConfigRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.UpdateAgentConfigResponse|null) => void
): UnaryResponse;
updateAgentConfig(
requestMessage: app_agent_v1_agent_pb.UpdateAgentConfigRequest,
callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.UpdateAgentConfigResponse|null) => void
): UnaryResponse;
}

export class AgentDeviceServiceClient {
readonly serviceHost: string;

constructor(serviceHost: string, options?: grpc.RpcOptions);
deviceAgentConfig(
requestMessage: app_agent_v1_agent_pb.DeviceAgentConfigRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.DeviceAgentConfigResponse|null) => void
): UnaryResponse;
deviceAgentConfig(
requestMessage: app_agent_v1_agent_pb.DeviceAgentConfigRequest,
callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.DeviceAgentConfigResponse|null) => void
): UnaryResponse;
}

156 changes: 156 additions & 0 deletions gen/js/app/agent/v1/agent_pb_service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
// package: viam.app.agent.v1
// file: app/agent/v1/agent.proto

var app_agent_v1_agent_pb = require("../../../app/agent/v1/agent_pb");
var grpc = require("@improbable-eng/grpc-web").grpc;

var AgentAppService = (function () {
function AgentAppService() {}
AgentAppService.serviceName = "viam.app.agent.v1.AgentAppService";
return AgentAppService;
}());

AgentAppService.GetAgentConfig = {
methodName: "GetAgentConfig",
service: AgentAppService,
requestStream: false,
responseStream: false,
requestType: app_agent_v1_agent_pb.GetAgentConfigRequest,
responseType: app_agent_v1_agent_pb.GetAgentConfigResponse
};

AgentAppService.UpdateAgentConfig = {
methodName: "UpdateAgentConfig",
service: AgentAppService,
requestStream: false,
responseStream: false,
requestType: app_agent_v1_agent_pb.UpdateAgentConfigRequest,
responseType: app_agent_v1_agent_pb.UpdateAgentConfigResponse
};

exports.AgentAppService = AgentAppService;

function AgentAppServiceClient(serviceHost, options) {
this.serviceHost = serviceHost;
this.options = options || {};
}

AgentAppServiceClient.prototype.getAgentConfig = function getAgentConfig(requestMessage, metadata, callback) {
if (arguments.length === 2) {
callback = arguments[1];
}
var client = grpc.unary(AgentAppService.GetAgentConfig, {
request: requestMessage,
host: this.serviceHost,
metadata: metadata,
transport: this.options.transport,
debug: this.options.debug,
onEnd: function (response) {
if (callback) {
if (response.status !== grpc.Code.OK) {
var err = new Error(response.statusMessage);
err.code = response.status;
err.metadata = response.trailers;
callback(err, null);
} else {
callback(null, response.message);
}
}
}
});
return {
cancel: function () {
callback = null;
client.close();
}
};
};

AgentAppServiceClient.prototype.updateAgentConfig = function updateAgentConfig(requestMessage, metadata, callback) {
if (arguments.length === 2) {
callback = arguments[1];
}
var client = grpc.unary(AgentAppService.UpdateAgentConfig, {
request: requestMessage,
host: this.serviceHost,
metadata: metadata,
transport: this.options.transport,
debug: this.options.debug,
onEnd: function (response) {
if (callback) {
if (response.status !== grpc.Code.OK) {
var err = new Error(response.statusMessage);
err.code = response.status;
err.metadata = response.trailers;
callback(err, null);
} else {
callback(null, response.message);
}
}
}
});
return {
cancel: function () {
callback = null;
client.close();
}
};
};

exports.AgentAppServiceClient = AgentAppServiceClient;

var AgentDeviceService = (function () {
function AgentDeviceService() {}
AgentDeviceService.serviceName = "viam.app.agent.v1.AgentDeviceService";
return AgentDeviceService;
}());

AgentDeviceService.DeviceAgentConfig = {
methodName: "DeviceAgentConfig",
service: AgentDeviceService,
requestStream: false,
responseStream: false,
requestType: app_agent_v1_agent_pb.DeviceAgentConfigRequest,
responseType: app_agent_v1_agent_pb.DeviceAgentConfigResponse
};

exports.AgentDeviceService = AgentDeviceService;

function AgentDeviceServiceClient(serviceHost, options) {
this.serviceHost = serviceHost;
this.options = options || {};
}

AgentDeviceServiceClient.prototype.deviceAgentConfig = function deviceAgentConfig(requestMessage, metadata, callback) {
if (arguments.length === 2) {
callback = arguments[1];
}
var client = grpc.unary(AgentDeviceService.DeviceAgentConfig, {
request: requestMessage,
host: this.serviceHost,
metadata: metadata,
transport: this.options.transport,
debug: this.options.debug,
onEnd: function (response) {
if (callback) {
if (response.status !== grpc.Code.OK) {
var err = new Error(response.statusMessage);
err.code = response.status;
err.metadata = response.trailers;
callback(err, null);
} else {
callback(null, response.message);
}
}
}
});
return {
cancel: function () {
callback = null;
client.close();
}
};
};

exports.AgentDeviceServiceClient = AgentDeviceServiceClient;

114 changes: 114 additions & 0 deletions proto/viam/app/agent/v1/agent.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
syntax = "proto3";

package viam.app.agent.v1;

import "google/protobuf/duration.proto";
import "tagger/v1/tagger.proto";

option go_package = "go.viam.com/api/app/agent/v1";

// AgentService is used by viam-agent to retrieve update info for subsystems.
service AgentAppService {
// GetAgentConfig is for retrieving config in App.
rpc GetAgentConfig(GetAgentConfigRequest) returns (GetAgentConfigResponse);

// UpdateAgentConfig is for editing config in App.
rpc UpdateAgentConfig(UpdateAgentConfigRequest) returns (UpdateAgentConfigResponse);
}

service AgentDeviceService {
// DeviceAgentConfig is for retrieving config by the on-device agent.
rpc DeviceAgentConfig(DeviceAgentConfigRequest) returns (DeviceAgentConfigResponse);
}

// App side
message GetAgentConfigRequest {
string id = 1;
}

message GetAgentConfigResponse {
AppAgentConfig agent_config = 1;
}

message UpdateAgentConfigRequest {
string id = 1;
AppAgentConfig agent_config = 2;
}

message UpdateAgentConfigResponse {
AppAgentConfig agent_config = 1;
}

message AppAgentConfig {
map<string, AppSubsystemConfig> subsystem_configs = 1 [(tagger.v1.tags) = "bson:\"subsystem_configs\" json:\"subsystem_configs\""];
}

message AppSubsystemConfig {
string release_channel = 1 [(tagger.v1.tags) = "bson:\"release_channel\" json:\"release_channel\""];
string pin_version = 2 [(tagger.v1.tags) = "bson:\"pin_version\" json:\"pin_version\""];
string pin_url = 3 [(tagger.v1.tags) = "bson:\"pin_url\" json:\"pin_url\""];
bool disable_subsystem = 4 [(tagger.v1.tags) = "bson:\"disable_subsystem\" json:\"disable_subsystem\""];
}

// Device side
message DeviceAgentConfigRequest {
// robot partID
string id = 1;
// info about the host system
HostInfo host_info = 2;
// current subsystems and versions
map<string, string> subsystem_versions = 3;
}

message DeviceAgentConfigResponse {
// subsystems to be installed/configured/updated
// note: previously installed subsystems will be removed from the system if removed from this list
map<string, DeviceSubsystemConfig> subsystem_configs = 1;
// how often this request should be repeated
google.protobuf.Duration check_interval = 2;
}

message DeviceSubsystemConfig {
// data needed to download/validate the subsystem
SubsystemUpdateInfo update_info = 1;
// if this subsystem is disabled and should not be started by the agent
bool disable = 2;
// force_restart will restart the subsystem, even if no updates are available
bool force_restart = 3;
}

message HostInfo {
// platform is the docker styled combination of kernel and architecture. Ex: linux/amd64, darwin/arm64
string platform = 1;
// ID and VERSION_ID fields from /etc/os-release, colon seperated. Ex: ubuntu:22.04, debian:11
string distro = 2;
// additional tags for specific hardware or software that's present and may affect software selection
// ex: "jetson", "rpi4", "systemd", etc.
repeated string tags = 3;
}

message SubsystemUpdateInfo {
// unpacked filename as it is expected on disk (regardless of url)
string filename = 1;
// url to download from
string url = 2;
// version expected at the url
string version = 3;
// sha256 sum of file as downloaded
bytes sha256 = 4;
// determines if decompression or executable permissions are needed
PackageFormat format = 5;
}

enum PackageFormat {
// unknown/unset (autodetection may be attempted)
PACKAGE_FORMAT_UNSPECIFIED = 0;
// do nothing
PACKAGE_FORMAT_RAW = 1;
// decompress .xz file
PACKAGE_FORMAT_XZ = 2;
// set executable permissions
PACKAGE_FORMAT_EXECUTABLE = 3;
// decompress and set executable
PACKAGE_FORMAT_XZ_EXECUTABLE = 4;
}