feat(agent): oto-agent 연결 유지 흐름을 추가한다
iop Edge의 oto-agent online 전환은 등록 후 유지되는 proto-socket heartbeat가 필요하므로 등록 세션을 명시적으로 보존한다. protobuf 6 생성물과 SDK 범위를 맞추고, iop2oto checkout을 대상으로 accepted와 first-heartbeat online 증거를 확인하는 smoke를 갱신한다.
This commit is contained in:
parent
8fafeb5cde
commit
2932427759
21 changed files with 2716 additions and 2951 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:oto/cli/cli.dart';
|
||||
import 'package:oto/oto/agent/agent_config.dart';
|
||||
import 'package:oto/oto/agent/edge_registration_client.dart';
|
||||
|
|
@ -18,19 +19,31 @@ class RegistrationException implements Exception {
|
|||
class DefaultAgentRunner implements AgentRunner {
|
||||
final EdgeRegistrationClient _client;
|
||||
final void Function(String)? _onLog;
|
||||
final Future<void> Function()? _waitForShutdown;
|
||||
|
||||
DefaultAgentRunner({
|
||||
EdgeRegistrationClient? client,
|
||||
void Function(String)? onLog,
|
||||
Future<void> Function()? waitForShutdown,
|
||||
}) : _client = client ?? EdgeRegistrationClient(),
|
||||
_onLog = onLog;
|
||||
_onLog = onLog,
|
||||
_waitForShutdown = waitForShutdown;
|
||||
|
||||
@override
|
||||
Future<void> run(AgentConfig config) async {
|
||||
_log('Starting registration with OTO Edge at "${config.edge.url}"...');
|
||||
|
||||
final EdgeAgentSession session;
|
||||
try {
|
||||
final result = await _client.register(config);
|
||||
session = await _client.openSession(config);
|
||||
} on RegistrationException {
|
||||
rethrow;
|
||||
} catch (e) {
|
||||
throw RegistrationException('Connection failed: $e');
|
||||
}
|
||||
|
||||
try {
|
||||
final result = session.result;
|
||||
|
||||
if (!result.accepted) {
|
||||
throw RegistrationException(result.rejectReason ??
|
||||
|
|
@ -42,10 +55,42 @@ class DefaultAgentRunner implements AgentRunner {
|
|||
if (result.alias != null) {
|
||||
_log('Alias: ${result.alias}');
|
||||
}
|
||||
} on RegistrationException {
|
||||
rethrow;
|
||||
} catch (e) {
|
||||
throw RegistrationException('Connection failed: $e');
|
||||
|
||||
_log('Agent connected. Waiting for shutdown signal...');
|
||||
await _awaitShutdown();
|
||||
} finally {
|
||||
await session.close();
|
||||
}
|
||||
}
|
||||
|
||||
/// 등록 성공 후 종료 신호를 기다린다. 테스트는 [waitForShutdown]를 주입해
|
||||
/// hang 없이 연결 유지/정리 흐름을 검증한다.
|
||||
Future<void> _awaitShutdown() async {
|
||||
final waitForShutdown = _waitForShutdown;
|
||||
if (waitForShutdown != null) {
|
||||
await waitForShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
final completer = Completer<void>();
|
||||
final subscriptions = <StreamSubscription<ProcessSignal>>[];
|
||||
void requestStop() {
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete();
|
||||
}
|
||||
}
|
||||
|
||||
subscriptions
|
||||
.add(ProcessSignal.sigint.watch().listen((_) => requestStop()));
|
||||
subscriptions
|
||||
.add(ProcessSignal.sigterm.watch().listen((_) => requestStop()));
|
||||
|
||||
try {
|
||||
await completer.future;
|
||||
} finally {
|
||||
for (final subscription in subscriptions) {
|
||||
await subscription.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,8 +103,38 @@ class _OtoIopClient extends ProtobufClient {
|
|||
});
|
||||
}
|
||||
|
||||
/// Edge에 등록한 뒤에도 연결을 유지하는 agent session.
|
||||
///
|
||||
/// registration accepted 이후 최초 heartbeat까지 살아 있어야 하는 OTO agent를
|
||||
/// 위해, connection을 닫지 않고 보존한다. session 소유자는 종료 시 [close]를
|
||||
/// 호출해 transport를 정리할 책임이 있다.
|
||||
abstract class EdgeAgentSession {
|
||||
/// register 요청에 대한 Edge 응답 결과.
|
||||
RegistrationResult get result;
|
||||
|
||||
/// 유지 중인 Edge 연결을 닫는다. 여러 번 호출해도 안전하다.
|
||||
Future<void> close();
|
||||
}
|
||||
|
||||
class _OtoEdgeAgentSession implements EdgeAgentSession {
|
||||
final _OtoIopClient _client;
|
||||
|
||||
@override
|
||||
final RegistrationResult result;
|
||||
|
||||
_OtoEdgeAgentSession(this._client, this.result);
|
||||
|
||||
@override
|
||||
Future<void> close() => _client.close();
|
||||
}
|
||||
|
||||
class EdgeRegistrationClient {
|
||||
Future<RegistrationResult> register(AgentConfig config) async {
|
||||
/// Edge에 연결해 register 요청을 보낸 뒤, 연결을 유지한 채 session을 돌려준다.
|
||||
///
|
||||
/// 반환된 [EdgeAgentSession] 소유자는 종료 시 반드시 [EdgeAgentSession.close]를
|
||||
/// 호출해야 한다. 연결 단계에서 실패하면 내부에서 transport를 닫고 예외를
|
||||
/// 다시 던지므로 leak이 생기지 않는다.
|
||||
Future<EdgeAgentSession> openSession(AgentConfig config) async {
|
||||
final endpoint = EdgeEndpoint.parse(config.edge.url);
|
||||
final socket = await ProtobufClient.connect(endpoint.host, endpoint.port);
|
||||
final client = _OtoIopClient(socket);
|
||||
|
|
@ -114,9 +144,21 @@ class EdgeRegistrationClient {
|
|||
iop.RegisterRequest()..token = config.agent.enrollmentToken,
|
||||
timeout: const Duration(seconds: 5),
|
||||
);
|
||||
return RegistrationResult.fromResponse(response);
|
||||
} finally {
|
||||
return _OtoEdgeAgentSession(
|
||||
client, RegistrationResult.fromResponse(response));
|
||||
} catch (_) {
|
||||
await client.close();
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
/// 연결을 유지하지 않는 one-shot 등록. 결과를 받은 뒤 즉시 연결을 닫는다.
|
||||
Future<RegistrationResult> register(AgentConfig config) async {
|
||||
final session = await openSession(config);
|
||||
try {
|
||||
return session.result;
|
||||
} finally {
|
||||
await session.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,283 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
||||
|
||||
import 'struct.pbenum.dart';
|
||||
|
||||
export 'struct.pbenum.dart';
|
||||
|
||||
/// `Struct` represents a structured data value, consisting of fields
|
||||
/// which map to dynamically typed values. In some languages, `Struct`
|
||||
/// might be supported by a native representation. For example, in
|
||||
/// scripting languages like JS a struct is represented as an
|
||||
/// object. The details of that representation are described together
|
||||
/// with the proto support for the language.
|
||||
///
|
||||
/// The JSON representation for `Struct` is JSON object.
|
||||
class Struct extends $pb.GeneratedMessage with $mixin.StructMixin {
|
||||
factory Struct({
|
||||
$core.Map<$core.String, Value>? fields,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (fields != null) {
|
||||
$result.fields.addAll(fields);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
Struct._() : super();
|
||||
factory Struct.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Struct.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Struct', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.StructMixin.toProto3JsonHelper, fromProto3Json: $mixin.StructMixin.fromProto3JsonHelper)
|
||||
..m<$core.String, Value>(1, _omitFieldNames ? '' : 'fields', entryClassName: 'Struct.FieldsEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OM, valueCreator: Value.create, valueDefaultOrMaker: Value.getDefault, packageName: const $pb.PackageName('google.protobuf'))
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Struct clone() => Struct()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Struct copyWith(void Function(Struct) updates) => super.copyWith((message) => updates(message as Struct)) as Struct;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Struct create() => Struct._();
|
||||
Struct createEmptyInstance() => create();
|
||||
static $pb.PbList<Struct> createRepeated() => $pb.PbList<Struct>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Struct getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Struct>(create);
|
||||
static Struct? _defaultInstance;
|
||||
|
||||
/// Unordered map of dynamically typed values.
|
||||
@$pb.TagNumber(1)
|
||||
$core.Map<$core.String, Value> get fields => $_getMap(0);
|
||||
}
|
||||
|
||||
enum Value_Kind {
|
||||
nullValue,
|
||||
numberValue,
|
||||
stringValue,
|
||||
boolValue,
|
||||
structValue,
|
||||
listValue,
|
||||
notSet
|
||||
}
|
||||
|
||||
/// `Value` represents a dynamically typed value which can be either
|
||||
/// null, a number, a string, a boolean, a recursive struct value, or a
|
||||
/// list of values. A producer of value is expected to set one of these
|
||||
/// variants. Absence of any variant indicates an error.
|
||||
///
|
||||
/// The JSON representation for `Value` is JSON value.
|
||||
class Value extends $pb.GeneratedMessage with $mixin.ValueMixin {
|
||||
factory Value({
|
||||
NullValue? nullValue,
|
||||
$core.double? numberValue,
|
||||
$core.String? stringValue,
|
||||
$core.bool? boolValue,
|
||||
Struct? structValue,
|
||||
ListValue? listValue,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (nullValue != null) {
|
||||
$result.nullValue = nullValue;
|
||||
}
|
||||
if (numberValue != null) {
|
||||
$result.numberValue = numberValue;
|
||||
}
|
||||
if (stringValue != null) {
|
||||
$result.stringValue = stringValue;
|
||||
}
|
||||
if (boolValue != null) {
|
||||
$result.boolValue = boolValue;
|
||||
}
|
||||
if (structValue != null) {
|
||||
$result.structValue = structValue;
|
||||
}
|
||||
if (listValue != null) {
|
||||
$result.listValue = listValue;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
Value._() : super();
|
||||
factory Value.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Value.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static const $core.Map<$core.int, Value_Kind> _Value_KindByTag = {
|
||||
1 : Value_Kind.nullValue,
|
||||
2 : Value_Kind.numberValue,
|
||||
3 : Value_Kind.stringValue,
|
||||
4 : Value_Kind.boolValue,
|
||||
5 : Value_Kind.structValue,
|
||||
6 : Value_Kind.listValue,
|
||||
0 : Value_Kind.notSet
|
||||
};
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Value', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.ValueMixin.toProto3JsonHelper, fromProto3Json: $mixin.ValueMixin.fromProto3JsonHelper)
|
||||
..oo(0, [1, 2, 3, 4, 5, 6])
|
||||
..e<NullValue>(1, _omitFieldNames ? '' : 'nullValue', $pb.PbFieldType.OE, defaultOrMaker: NullValue.NULL_VALUE, valueOf: NullValue.valueOf, enumValues: NullValue.values)
|
||||
..a<$core.double>(2, _omitFieldNames ? '' : 'numberValue', $pb.PbFieldType.OD)
|
||||
..aOS(3, _omitFieldNames ? '' : 'stringValue')
|
||||
..aOB(4, _omitFieldNames ? '' : 'boolValue')
|
||||
..aOM<Struct>(5, _omitFieldNames ? '' : 'structValue', subBuilder: Struct.create)
|
||||
..aOM<ListValue>(6, _omitFieldNames ? '' : 'listValue', subBuilder: ListValue.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Value clone() => Value()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Value copyWith(void Function(Value) updates) => super.copyWith((message) => updates(message as Value)) as Value;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Value create() => Value._();
|
||||
Value createEmptyInstance() => create();
|
||||
static $pb.PbList<Value> createRepeated() => $pb.PbList<Value>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Value getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Value>(create);
|
||||
static Value? _defaultInstance;
|
||||
|
||||
Value_Kind whichKind() => _Value_KindByTag[$_whichOneof(0)]!;
|
||||
void clearKind() => clearField($_whichOneof(0));
|
||||
|
||||
/// Represents a null value.
|
||||
@$pb.TagNumber(1)
|
||||
NullValue get nullValue => $_getN(0);
|
||||
@$pb.TagNumber(1)
|
||||
set nullValue(NullValue v) { setField(1, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasNullValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearNullValue() => clearField(1);
|
||||
|
||||
/// Represents a double value.
|
||||
@$pb.TagNumber(2)
|
||||
$core.double get numberValue => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set numberValue($core.double v) { $_setDouble(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasNumberValue() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearNumberValue() => clearField(2);
|
||||
|
||||
/// Represents a string value.
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get stringValue => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set stringValue($core.String v) { $_setString(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasStringValue() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearStringValue() => clearField(3);
|
||||
|
||||
/// Represents a boolean value.
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool get boolValue => $_getBF(3);
|
||||
@$pb.TagNumber(4)
|
||||
set boolValue($core.bool v) { $_setBool(3, v); }
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasBoolValue() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearBoolValue() => clearField(4);
|
||||
|
||||
/// Represents a structured value.
|
||||
@$pb.TagNumber(5)
|
||||
Struct get structValue => $_getN(4);
|
||||
@$pb.TagNumber(5)
|
||||
set structValue(Struct v) { setField(5, v); }
|
||||
@$pb.TagNumber(5)
|
||||
$core.bool hasStructValue() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearStructValue() => clearField(5);
|
||||
@$pb.TagNumber(5)
|
||||
Struct ensureStructValue() => $_ensure(4);
|
||||
|
||||
/// Represents a repeated `Value`.
|
||||
@$pb.TagNumber(6)
|
||||
ListValue get listValue => $_getN(5);
|
||||
@$pb.TagNumber(6)
|
||||
set listValue(ListValue v) { setField(6, v); }
|
||||
@$pb.TagNumber(6)
|
||||
$core.bool hasListValue() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
void clearListValue() => clearField(6);
|
||||
@$pb.TagNumber(6)
|
||||
ListValue ensureListValue() => $_ensure(5);
|
||||
}
|
||||
|
||||
/// `ListValue` is a wrapper around a repeated field of values.
|
||||
///
|
||||
/// The JSON representation for `ListValue` is JSON array.
|
||||
class ListValue extends $pb.GeneratedMessage with $mixin.ListValueMixin {
|
||||
factory ListValue({
|
||||
$core.Iterable<Value>? values,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (values != null) {
|
||||
$result.values.addAll(values);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
ListValue._() : super();
|
||||
factory ListValue.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory ListValue.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ListValue', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.ListValueMixin.toProto3JsonHelper, fromProto3Json: $mixin.ListValueMixin.fromProto3JsonHelper)
|
||||
..pc<Value>(1, _omitFieldNames ? '' : 'values', $pb.PbFieldType.PM, subBuilder: Value.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
ListValue clone() => ListValue()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ListValue copyWith(void Function(ListValue) updates) => super.copyWith((message) => updates(message as ListValue)) as ListValue;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ListValue create() => ListValue._();
|
||||
ListValue createEmptyInstance() => create();
|
||||
static $pb.PbList<ListValue> createRepeated() => $pb.PbList<ListValue>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ListValue getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ListValue>(create);
|
||||
static ListValue? _defaultInstance;
|
||||
|
||||
/// Repeated field of dynamically typed values.
|
||||
@$pb.TagNumber(1)
|
||||
$core.List<Value> get values => $_getList(0);
|
||||
}
|
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// `NullValue` is a singleton enumeration to represent the null value for the
|
||||
/// `Value` type union.
|
||||
///
|
||||
/// The JSON representation for `NullValue` is JSON `null`.
|
||||
class NullValue extends $pb.ProtobufEnum {
|
||||
static const NullValue NULL_VALUE = NullValue._(0, _omitEnumNames ? '' : 'NULL_VALUE');
|
||||
|
||||
static const $core.List<NullValue> values = <NullValue> [
|
||||
NULL_VALUE,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, NullValue> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static NullValue? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const NullValue._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use nullValueDescriptor instead')
|
||||
const NullValue$json = {
|
||||
'1': 'NullValue',
|
||||
'2': [
|
||||
{'1': 'NULL_VALUE', '2': 0},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NullValue`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List nullValueDescriptor = $convert.base64Decode(
|
||||
'CglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAA');
|
||||
|
||||
@$core.Deprecated('Use structDescriptor instead')
|
||||
const Struct$json = {
|
||||
'1': 'Struct',
|
||||
'2': [
|
||||
{'1': 'fields', '3': 1, '4': 3, '5': 11, '6': '.google.protobuf.Struct.FieldsEntry', '10': 'fields'},
|
||||
],
|
||||
'3': [Struct_FieldsEntry$json],
|
||||
};
|
||||
|
||||
@$core.Deprecated('Use structDescriptor instead')
|
||||
const Struct_FieldsEntry$json = {
|
||||
'1': 'FieldsEntry',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.google.protobuf.Value', '10': 'value'},
|
||||
],
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
/// Descriptor for `Struct`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List structDescriptor = $convert.base64Decode(
|
||||
'CgZTdHJ1Y3QSOwoGZmllbGRzGAEgAygLMiMuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdC5GaWVsZH'
|
||||
'NFbnRyeVIGZmllbGRzGlEKC0ZpZWxkc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EiwKBXZhbHVl'
|
||||
'GAIgASgLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgV2YWx1ZToCOAE=');
|
||||
|
||||
@$core.Deprecated('Use valueDescriptor instead')
|
||||
const Value$json = {
|
||||
'1': 'Value',
|
||||
'2': [
|
||||
{'1': 'null_value', '3': 1, '4': 1, '5': 14, '6': '.google.protobuf.NullValue', '9': 0, '10': 'nullValue'},
|
||||
{'1': 'number_value', '3': 2, '4': 1, '5': 1, '9': 0, '10': 'numberValue'},
|
||||
{'1': 'string_value', '3': 3, '4': 1, '5': 9, '9': 0, '10': 'stringValue'},
|
||||
{'1': 'bool_value', '3': 4, '4': 1, '5': 8, '9': 0, '10': 'boolValue'},
|
||||
{'1': 'struct_value', '3': 5, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '9': 0, '10': 'structValue'},
|
||||
{'1': 'list_value', '3': 6, '4': 1, '5': 11, '6': '.google.protobuf.ListValue', '9': 0, '10': 'listValue'},
|
||||
],
|
||||
'8': [
|
||||
{'1': 'kind'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Value`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List valueDescriptor = $convert.base64Decode(
|
||||
'CgVWYWx1ZRI7CgpudWxsX3ZhbHVlGAEgASgOMhouZ29vZ2xlLnByb3RvYnVmLk51bGxWYWx1ZU'
|
||||
'gAUgludWxsVmFsdWUSIwoMbnVtYmVyX3ZhbHVlGAIgASgBSABSC251bWJlclZhbHVlEiMKDHN0'
|
||||
'cmluZ192YWx1ZRgDIAEoCUgAUgtzdHJpbmdWYWx1ZRIfCgpib29sX3ZhbHVlGAQgASgISABSCW'
|
||||
'Jvb2xWYWx1ZRI8CgxzdHJ1Y3RfdmFsdWUYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0'
|
||||
'SABSC3N0cnVjdFZhbHVlEjsKCmxpc3RfdmFsdWUYBiABKAsyGi5nb29nbGUucHJvdG9idWYuTG'
|
||||
'lzdFZhbHVlSABSCWxpc3RWYWx1ZUIGCgRraW5k');
|
||||
|
||||
@$core.Deprecated('Use listValueDescriptor instead')
|
||||
const ListValue$json = {
|
||||
'1': 'ListValue',
|
||||
'2': [
|
||||
{'1': 'values', '3': 1, '4': 3, '5': 11, '6': '.google.protobuf.Value', '10': 'values'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ListValue`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listValueDescriptor = $convert.base64Decode(
|
||||
'CglMaXN0VmFsdWUSLgoGdmFsdWVzGAEgAygLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgZ2YW'
|
||||
'x1ZXM=');
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
export 'struct.pb.dart';
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,72 +1,100 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: iop/runtime.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// Generated from iop/runtime.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class RunSessionMode extends $pb.ProtobufEnum {
|
||||
static const RunSessionMode RUN_SESSION_MODE_UNSPECIFIED = RunSessionMode._(0, _omitEnumNames ? '' : 'RUN_SESSION_MODE_UNSPECIFIED');
|
||||
static const RunSessionMode RUN_SESSION_MODE_CREATE_IF_MISSING = RunSessionMode._(1, _omitEnumNames ? '' : 'RUN_SESSION_MODE_CREATE_IF_MISSING');
|
||||
static const RunSessionMode RUN_SESSION_MODE_REQUIRE_EXISTING = RunSessionMode._(2, _omitEnumNames ? '' : 'RUN_SESSION_MODE_REQUIRE_EXISTING');
|
||||
static const RunSessionMode RUN_SESSION_MODE_UNSPECIFIED =
|
||||
RunSessionMode._(0, _omitEnumNames ? '' : 'RUN_SESSION_MODE_UNSPECIFIED');
|
||||
static const RunSessionMode RUN_SESSION_MODE_CREATE_IF_MISSING =
|
||||
RunSessionMode._(
|
||||
1, _omitEnumNames ? '' : 'RUN_SESSION_MODE_CREATE_IF_MISSING');
|
||||
static const RunSessionMode RUN_SESSION_MODE_REQUIRE_EXISTING =
|
||||
RunSessionMode._(
|
||||
2, _omitEnumNames ? '' : 'RUN_SESSION_MODE_REQUIRE_EXISTING');
|
||||
|
||||
static const $core.List<RunSessionMode> values = <RunSessionMode> [
|
||||
static const $core.List<RunSessionMode> values = <RunSessionMode>[
|
||||
RUN_SESSION_MODE_UNSPECIFIED,
|
||||
RUN_SESSION_MODE_CREATE_IF_MISSING,
|
||||
RUN_SESSION_MODE_REQUIRE_EXISTING,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, RunSessionMode> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static RunSessionMode? valueOf($core.int value) => _byValue[value];
|
||||
static final $core.List<RunSessionMode?> _byValue =
|
||||
$pb.ProtobufEnum.$_initByValueList(values, 2);
|
||||
static RunSessionMode? valueOf($core.int value) =>
|
||||
value < 0 || value >= _byValue.length ? null : _byValue[value];
|
||||
|
||||
const RunSessionMode._($core.int v, $core.String n) : super(v, n);
|
||||
const RunSessionMode._(super.value, super.name);
|
||||
}
|
||||
|
||||
class CancelAction extends $pb.ProtobufEnum {
|
||||
static const CancelAction CANCEL_ACTION_UNSPECIFIED = CancelAction._(0, _omitEnumNames ? '' : 'CANCEL_ACTION_UNSPECIFIED');
|
||||
static const CancelAction CANCEL_ACTION_CANCEL_RUN = CancelAction._(1, _omitEnumNames ? '' : 'CANCEL_ACTION_CANCEL_RUN');
|
||||
static const CancelAction CANCEL_ACTION_TERMINATE_SESSION = CancelAction._(2, _omitEnumNames ? '' : 'CANCEL_ACTION_TERMINATE_SESSION');
|
||||
static const CancelAction CANCEL_ACTION_UNSPECIFIED =
|
||||
CancelAction._(0, _omitEnumNames ? '' : 'CANCEL_ACTION_UNSPECIFIED');
|
||||
static const CancelAction CANCEL_ACTION_CANCEL_RUN =
|
||||
CancelAction._(1, _omitEnumNames ? '' : 'CANCEL_ACTION_CANCEL_RUN');
|
||||
static const CancelAction CANCEL_ACTION_TERMINATE_SESSION = CancelAction._(
|
||||
2, _omitEnumNames ? '' : 'CANCEL_ACTION_TERMINATE_SESSION');
|
||||
|
||||
static const $core.List<CancelAction> values = <CancelAction> [
|
||||
static const $core.List<CancelAction> values = <CancelAction>[
|
||||
CANCEL_ACTION_UNSPECIFIED,
|
||||
CANCEL_ACTION_CANCEL_RUN,
|
||||
CANCEL_ACTION_TERMINATE_SESSION,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, CancelAction> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static CancelAction? valueOf($core.int value) => _byValue[value];
|
||||
static final $core.List<CancelAction?> _byValue =
|
||||
$pb.ProtobufEnum.$_initByValueList(values, 2);
|
||||
static CancelAction? valueOf($core.int value) =>
|
||||
value < 0 || value >= _byValue.length ? null : _byValue[value];
|
||||
|
||||
const CancelAction._($core.int v, $core.String n) : super(v, n);
|
||||
const CancelAction._(super.value, super.name);
|
||||
}
|
||||
|
||||
class NodeCommandType extends $pb.ProtobufEnum {
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_UNSPECIFIED = NodeCommandType._(0, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_UNSPECIFIED');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_USAGE_STATUS = NodeCommandType._(1, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_USAGE_STATUS');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_CAPABILITIES = NodeCommandType._(2, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_CAPABILITIES');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_SESSION_LIST = NodeCommandType._(3, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_SESSION_LIST');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_TRANSPORT_STATUS = NodeCommandType._(4, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_TRANSPORT_STATUS');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_UNSPECIFIED =
|
||||
NodeCommandType._(
|
||||
0, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_UNSPECIFIED');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_USAGE_STATUS =
|
||||
NodeCommandType._(
|
||||
1, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_USAGE_STATUS');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_CAPABILITIES =
|
||||
NodeCommandType._(
|
||||
2, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_CAPABILITIES');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_SESSION_LIST =
|
||||
NodeCommandType._(
|
||||
3, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_SESSION_LIST');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_TRANSPORT_STATUS =
|
||||
NodeCommandType._(
|
||||
4, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_TRANSPORT_STATUS');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_OLLAMA_API = NodeCommandType._(
|
||||
5, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_OLLAMA_API');
|
||||
|
||||
static const $core.List<NodeCommandType> values = <NodeCommandType> [
|
||||
static const $core.List<NodeCommandType> values = <NodeCommandType>[
|
||||
NODE_COMMAND_TYPE_UNSPECIFIED,
|
||||
NODE_COMMAND_TYPE_USAGE_STATUS,
|
||||
NODE_COMMAND_TYPE_CAPABILITIES,
|
||||
NODE_COMMAND_TYPE_SESSION_LIST,
|
||||
NODE_COMMAND_TYPE_TRANSPORT_STATUS,
|
||||
NODE_COMMAND_TYPE_OLLAMA_API,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, NodeCommandType> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static NodeCommandType? valueOf($core.int value) => _byValue[value];
|
||||
static final $core.List<NodeCommandType?> _byValue =
|
||||
$pb.ProtobufEnum.$_initByValueList(values, 5);
|
||||
static NodeCommandType? valueOf($core.int value) =>
|
||||
value < 0 || value >= _byValue.length ? null : _byValue[value];
|
||||
|
||||
const NodeCommandType._($core.int v, $core.String n) : super(v, n);
|
||||
const NodeCommandType._(super.value, super.name);
|
||||
}
|
||||
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
const $core.bool _omitEnumNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: iop/runtime.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// Generated from iop/runtime.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
|
|
@ -54,6 +56,7 @@ const NodeCommandType$json = {
|
|||
{'1': 'NODE_COMMAND_TYPE_CAPABILITIES', '2': 2},
|
||||
{'1': 'NODE_COMMAND_TYPE_SESSION_LIST', '2': 3},
|
||||
{'1': 'NODE_COMMAND_TYPE_TRANSPORT_STATUS', '2': 4},
|
||||
{'1': 'NODE_COMMAND_TYPE_OLLAMA_API', '2': 5},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -62,7 +65,8 @@ final $typed_data.Uint8List nodeCommandTypeDescriptor = $convert.base64Decode(
|
|||
'Cg9Ob2RlQ29tbWFuZFR5cGUSIQodTk9ERV9DT01NQU5EX1RZUEVfVU5TUEVDSUZJRUQQABIiCh'
|
||||
'5OT0RFX0NPTU1BTkRfVFlQRV9VU0FHRV9TVEFUVVMQARIiCh5OT0RFX0NPTU1BTkRfVFlQRV9D'
|
||||
'QVBBQklMSVRJRVMQAhIiCh5OT0RFX0NPTU1BTkRfVFlQRV9TRVNTSU9OX0xJU1QQAxImCiJOT0'
|
||||
'RFX0NPTU1BTkRfVFlQRV9UUkFOU1BPUlRfU1RBVFVTEAQ=');
|
||||
'RFX0NPTU1BTkRfVFlQRV9UUkFOU1BPUlRfU1RBVFVTEAQSIAocTk9ERV9DT01NQU5EX1RZUEVf'
|
||||
'T0xMQU1BX0FQSRAF');
|
||||
|
||||
@$core.Deprecated('Use runRequestDescriptor instead')
|
||||
const RunRequest$json = {
|
||||
|
|
@ -72,12 +76,40 @@ const RunRequest$json = {
|
|||
{'1': 'adapter', '3': 2, '4': 1, '5': 9, '10': 'adapter'},
|
||||
{'1': 'target', '3': 3, '4': 1, '5': 9, '10': 'target'},
|
||||
{'1': 'workspace', '3': 4, '4': 1, '5': 9, '10': 'workspace'},
|
||||
{'1': 'policy', '3': 5, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '10': 'policy'},
|
||||
{'1': 'input', '3': 6, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '10': 'input'},
|
||||
{
|
||||
'1': 'policy',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Struct',
|
||||
'10': 'policy'
|
||||
},
|
||||
{
|
||||
'1': 'input',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Struct',
|
||||
'10': 'input'
|
||||
},
|
||||
{'1': 'timeout_sec', '3': 7, '4': 1, '5': 5, '10': 'timeoutSec'},
|
||||
{'1': 'metadata', '3': 8, '4': 3, '5': 11, '6': '.iop.RunRequest.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 8,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.RunRequest.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
{'1': 'session_id', '3': 9, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'session_mode', '3': 10, '4': 1, '5': 14, '6': '.iop.RunSessionMode', '10': 'sessionMode'},
|
||||
{
|
||||
'1': 'session_mode',
|
||||
'3': 10,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.iop.RunSessionMode',
|
||||
'10': 'sessionMode'
|
||||
},
|
||||
{'1': 'background', '3': 11, '4': 1, '5': 8, '10': 'background'},
|
||||
],
|
||||
'3': [RunRequest_MetadataEntry$json],
|
||||
|
|
@ -115,7 +147,14 @@ const RunEvent$json = {
|
|||
{'1': 'message', '3': 4, '4': 1, '5': 9, '10': 'message'},
|
||||
{'1': 'error', '3': 5, '4': 1, '5': 9, '10': 'error'},
|
||||
{'1': 'usage', '3': 6, '4': 1, '5': 11, '6': '.iop.Usage', '10': 'usage'},
|
||||
{'1': 'metadata', '3': 7, '4': 3, '5': 11, '6': '.iop.RunEvent.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 7,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.RunEvent.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
{'1': 'timestamp', '3': 8, '4': 1, '5': 3, '10': 'timestamp'},
|
||||
{'1': 'session_id', '3': 9, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'background', '3': 10, '4': 1, '5': 8, '10': 'background'},
|
||||
|
|
@ -156,7 +195,14 @@ const EdgeNodeEvent$json = {
|
|||
{'1': 'node_id', '3': 4, '4': 1, '5': 9, '10': 'nodeId'},
|
||||
{'1': 'alias', '3': 5, '4': 1, '5': 9, '10': 'alias'},
|
||||
{'1': 'reason', '3': 6, '4': 1, '5': 9, '10': 'reason'},
|
||||
{'1': 'metadata', '3': 7, '4': 3, '5': 11, '6': '.iop.EdgeNodeEvent.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 7,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.EdgeNodeEvent.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
{'1': 'timestamp', '3': 8, '4': 1, '5': 3, '10': 'timestamp'},
|
||||
],
|
||||
'3': [EdgeNodeEvent_MetadataEntry$json],
|
||||
|
|
@ -204,8 +250,8 @@ const Heartbeat$json = {
|
|||
};
|
||||
|
||||
/// Descriptor for `Heartbeat`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List heartbeatDescriptor = $convert.base64Decode(
|
||||
'CglIZWFydGJlYXQSHAoJdGltZXN0YW1wGAEgASgDUgl0aW1lc3RhbXA=');
|
||||
final $typed_data.Uint8List heartbeatDescriptor = $convert
|
||||
.base64Decode('CglIZWFydGJlYXQSHAoJdGltZXN0YW1wGAEgASgDUgl0aW1lc3RhbXA=');
|
||||
|
||||
@$core.Deprecated('Use cancelRequestDescriptor instead')
|
||||
const CancelRequest$json = {
|
||||
|
|
@ -215,7 +261,14 @@ const CancelRequest$json = {
|
|||
{'1': 'adapter', '3': 2, '4': 1, '5': 9, '10': 'adapter'},
|
||||
{'1': 'target', '3': 3, '4': 1, '5': 9, '10': 'target'},
|
||||
{'1': 'session_id', '3': 4, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'action', '3': 5, '4': 1, '5': 14, '6': '.iop.CancelAction', '10': 'action'},
|
||||
{
|
||||
'1': 'action',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.iop.CancelAction',
|
||||
'10': 'action'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -230,12 +283,26 @@ const NodeCommandRequest$json = {
|
|||
'1': 'NodeCommandRequest',
|
||||
'2': [
|
||||
{'1': 'request_id', '3': 1, '4': 1, '5': 9, '10': 'requestId'},
|
||||
{'1': 'type', '3': 2, '4': 1, '5': 14, '6': '.iop.NodeCommandType', '10': 'type'},
|
||||
{
|
||||
'1': 'type',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.iop.NodeCommandType',
|
||||
'10': 'type'
|
||||
},
|
||||
{'1': 'adapter', '3': 3, '4': 1, '5': 9, '10': 'adapter'},
|
||||
{'1': 'target', '3': 4, '4': 1, '5': 9, '10': 'target'},
|
||||
{'1': 'session_id', '3': 5, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'timeout_sec', '3': 6, '4': 1, '5': 5, '10': 'timeoutSec'},
|
||||
{'1': 'metadata', '3': 7, '4': 3, '5': 11, '6': '.iop.NodeCommandRequest.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 7,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.NodeCommandRequest.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
],
|
||||
'3': [NodeCommandRequest_MetadataEntry$json],
|
||||
};
|
||||
|
|
@ -265,13 +332,34 @@ const NodeCommandResponse$json = {
|
|||
'1': 'NodeCommandResponse',
|
||||
'2': [
|
||||
{'1': 'request_id', '3': 1, '4': 1, '5': 9, '10': 'requestId'},
|
||||
{'1': 'type', '3': 2, '4': 1, '5': 14, '6': '.iop.NodeCommandType', '10': 'type'},
|
||||
{
|
||||
'1': 'type',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.iop.NodeCommandType',
|
||||
'10': 'type'
|
||||
},
|
||||
{'1': 'adapter', '3': 3, '4': 1, '5': 9, '10': 'adapter'},
|
||||
{'1': 'target', '3': 4, '4': 1, '5': 9, '10': 'target'},
|
||||
{'1': 'session_id', '3': 5, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'usage_status', '3': 6, '4': 1, '5': 11, '6': '.iop.AgentUsageStatus', '10': 'usageStatus'},
|
||||
{
|
||||
'1': 'usage_status',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.AgentUsageStatus',
|
||||
'10': 'usageStatus'
|
||||
},
|
||||
{'1': 'error', '3': 7, '4': 1, '5': 9, '10': 'error'},
|
||||
{'1': 'result', '3': 8, '4': 3, '5': 11, '6': '.iop.NodeCommandResponse.ResultEntry', '10': 'result'},
|
||||
{
|
||||
'1': 'result',
|
||||
'3': 8,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.NodeCommandResponse.ResultEntry',
|
||||
'10': 'result'
|
||||
},
|
||||
],
|
||||
'3': [NodeCommandResponse_ResultEntry$json],
|
||||
};
|
||||
|
|
@ -305,7 +393,14 @@ const AgentUsageStatus$json = {
|
|||
{'1': 'daily_reset_time', '3': 3, '4': 1, '5': 9, '10': 'dailyResetTime'},
|
||||
{'1': 'weekly_limit', '3': 4, '4': 1, '5': 9, '10': 'weeklyLimit'},
|
||||
{'1': 'weekly_reset_time', '3': 5, '4': 1, '5': 9, '10': 'weeklyResetTime'},
|
||||
{'1': 'metadata', '3': 6, '4': 3, '5': 11, '6': '.iop.AgentUsageStatus.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 6,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.AgentUsageStatus.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
],
|
||||
'3': [AgentUsageStatus_MetadataEntry$json],
|
||||
};
|
||||
|
|
@ -351,8 +446,8 @@ const RegisterRequest$json = {
|
|||
};
|
||||
|
||||
/// Descriptor for `RegisterRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List registerRequestDescriptor = $convert.base64Decode(
|
||||
'Cg9SZWdpc3RlclJlcXVlc3QSFAoFdG9rZW4YASABKAlSBXRva2Vu');
|
||||
final $typed_data.Uint8List registerRequestDescriptor = $convert
|
||||
.base64Decode('Cg9SZWdpc3RlclJlcXVlc3QSFAoFdG9rZW4YASABKAlSBXRva2Vu');
|
||||
|
||||
@$core.Deprecated('Use registerResponseDescriptor instead')
|
||||
const RegisterResponse$json = {
|
||||
|
|
@ -362,7 +457,14 @@ const RegisterResponse$json = {
|
|||
{'1': 'node_id', '3': 2, '4': 1, '5': 9, '10': 'nodeId'},
|
||||
{'1': 'alias', '3': 3, '4': 1, '5': 9, '10': 'alias'},
|
||||
{'1': 'reason', '3': 4, '4': 1, '5': 9, '10': 'reason'},
|
||||
{'1': 'config', '3': 5, '4': 1, '5': 11, '6': '.iop.NodeConfigPayload', '10': 'config'},
|
||||
{
|
||||
'1': 'config',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.NodeConfigPayload',
|
||||
'10': 'config'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -376,8 +478,22 @@ final $typed_data.Uint8List registerResponseDescriptor = $convert.base64Decode(
|
|||
const NodeConfigPayload$json = {
|
||||
'1': 'NodeConfigPayload',
|
||||
'2': [
|
||||
{'1': 'adapters', '3': 1, '4': 3, '5': 11, '6': '.iop.AdapterConfig', '10': 'adapters'},
|
||||
{'1': 'runtime', '3': 2, '4': 1, '5': 11, '6': '.iop.NodeRuntimeConfig', '10': 'runtime'},
|
||||
{
|
||||
'1': 'adapters',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.AdapterConfig',
|
||||
'10': 'adapters'
|
||||
},
|
||||
{
|
||||
'1': 'runtime',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.NodeRuntimeConfig',
|
||||
'10': 'runtime'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -393,10 +509,41 @@ const AdapterConfig$json = {
|
|||
'2': [
|
||||
{'1': 'type', '3': 1, '4': 1, '5': 9, '10': 'type'},
|
||||
{'1': 'enabled', '3': 2, '4': 1, '5': 8, '10': 'enabled'},
|
||||
{'1': 'settings', '3': 3, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '10': 'settings'},
|
||||
{'1': 'cli', '3': 4, '4': 1, '5': 11, '6': '.iop.CLIAdapterConfig', '9': 0, '10': 'cli'},
|
||||
{'1': 'ollama', '3': 5, '4': 1, '5': 11, '6': '.iop.OllamaAdapterConfig', '9': 0, '10': 'ollama'},
|
||||
{'1': 'vllm', '3': 6, '4': 1, '5': 11, '6': '.iop.VllmAdapterConfig', '9': 0, '10': 'vllm'},
|
||||
{
|
||||
'1': 'settings',
|
||||
'3': 3,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Struct',
|
||||
'10': 'settings'
|
||||
},
|
||||
{
|
||||
'1': 'cli',
|
||||
'3': 4,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.CLIAdapterConfig',
|
||||
'9': 0,
|
||||
'10': 'cli'
|
||||
},
|
||||
{
|
||||
'1': 'ollama',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.OllamaAdapterConfig',
|
||||
'9': 0,
|
||||
'10': 'ollama'
|
||||
},
|
||||
{
|
||||
'1': 'vllm',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.VllmAdapterConfig',
|
||||
'9': 0,
|
||||
'10': 'vllm'
|
||||
},
|
||||
],
|
||||
'8': [
|
||||
{'1': 'config'},
|
||||
|
|
@ -415,7 +562,14 @@ final $typed_data.Uint8List adapterConfigDescriptor = $convert.base64Decode(
|
|||
const CLIAdapterConfig$json = {
|
||||
'1': 'CLIAdapterConfig',
|
||||
'2': [
|
||||
{'1': 'profiles', '3': 1, '4': 3, '5': 11, '6': '.iop.CLIAdapterConfig.ProfilesEntry', '10': 'profiles'},
|
||||
{
|
||||
'1': 'profiles',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.CLIAdapterConfig.ProfilesEntry',
|
||||
'10': 'profiles'
|
||||
},
|
||||
],
|
||||
'3': [CLIAdapterConfig_ProfilesEntry$json],
|
||||
};
|
||||
|
|
@ -425,7 +579,14 @@ const CLIAdapterConfig_ProfilesEntry$json = {
|
|||
'1': 'ProfilesEntry',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.iop.CLIProfileConfig', '10': 'value'},
|
||||
{
|
||||
'1': 'value',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.CLIProfileConfig',
|
||||
'10': 'value'
|
||||
},
|
||||
],
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
|
@ -446,10 +607,29 @@ const CLIProfileConfig$json = {
|
|||
{'1': 'env', '3': 3, '4': 3, '5': 9, '10': 'env'},
|
||||
{'1': 'persistent', '3': 4, '4': 1, '5': 8, '10': 'persistent'},
|
||||
{'1': 'terminal', '3': 5, '4': 1, '5': 8, '10': 'terminal'},
|
||||
{'1': 'response_idle_timeout_ms', '3': 6, '4': 1, '5': 5, '10': 'responseIdleTimeoutMs'},
|
||||
{'1': 'startup_idle_timeout_ms', '3': 7, '4': 1, '5': 5, '10': 'startupIdleTimeoutMs'},
|
||||
{
|
||||
'1': 'response_idle_timeout_ms',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
'5': 5,
|
||||
'10': 'responseIdleTimeoutMs'
|
||||
},
|
||||
{
|
||||
'1': 'startup_idle_timeout_ms',
|
||||
'3': 7,
|
||||
'4': 1,
|
||||
'5': 5,
|
||||
'10': 'startupIdleTimeoutMs'
|
||||
},
|
||||
{'1': 'output_format', '3': 8, '4': 1, '5': 9, '10': 'outputFormat'},
|
||||
{'1': 'completion_marker', '3': 9, '4': 1, '5': 11, '6': '.iop.CLICompletionMarker', '10': 'completionMarker'},
|
||||
{
|
||||
'1': 'completion_marker',
|
||||
'3': 9,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.CLICompletionMarker',
|
||||
'10': 'completionMarker'
|
||||
},
|
||||
{'1': 'mode', '3': 10, '4': 1, '5': 9, '10': 'mode'},
|
||||
{'1': 'resume_args', '3': 11, '4': 3, '5': 9, '10': 'resumeArgs'},
|
||||
],
|
||||
|
|
@ -519,4 +699,3 @@ const NodeRuntimeConfig$json = {
|
|||
final $typed_data.Uint8List nodeRuntimeConfigDescriptor = $convert.base64Decode(
|
||||
'ChFOb2RlUnVudGltZUNvbmZpZxIgCgtjb25jdXJyZW5jeRgBIAEoBVILY29uY3VycmVuY3kSJQ'
|
||||
'oOd29ya3NwYWNlX3Jvb3QYAiABKAlSDXdvcmtzcGFjZVJvb3Q=');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: iop/runtime.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
export 'runtime.pb.dart';
|
||||
|
||||
|
|
@ -5,7 +5,7 @@ publish_to: none
|
|||
repository: https://git.toki-labs.com/toki/oto.git
|
||||
|
||||
environment:
|
||||
sdk: '>=3.2.3 <4.0.0'
|
||||
sdk: '>=3.8.0 <4.0.0'
|
||||
|
||||
# Add regular dependencies here.
|
||||
dependencies:
|
||||
|
|
@ -27,7 +27,7 @@ dependencies:
|
|||
url: https://git.toki-labs.com/toki/dart-app-core.git
|
||||
ref: master
|
||||
fixnum: ^1.1.1
|
||||
protobuf: ^3.1.0
|
||||
protobuf: ^6.0.0
|
||||
|
||||
dev_dependencies:
|
||||
lints: ^6.0.0
|
||||
|
|
|
|||
|
|
@ -1,16 +1,34 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:test/test.dart';
|
||||
import 'package:oto/oto/agent/agent_config.dart';
|
||||
import 'package:oto/oto/agent/agent_runner.dart';
|
||||
import 'package:oto/oto/agent/edge_registration_client.dart';
|
||||
|
||||
class FakeEdgeAgentSession implements EdgeAgentSession {
|
||||
@override
|
||||
final RegistrationResult result;
|
||||
bool closed = false;
|
||||
|
||||
FakeEdgeAgentSession(this.result);
|
||||
|
||||
@override
|
||||
Future<void> close() async {
|
||||
closed = true;
|
||||
}
|
||||
}
|
||||
|
||||
class FakeEdgeRegistrationClient extends EdgeRegistrationClient {
|
||||
final RegistrationResult Function(AgentConfig config) _onRegister;
|
||||
FakeEdgeAgentSession? lastSession;
|
||||
|
||||
FakeEdgeRegistrationClient(this._onRegister);
|
||||
|
||||
@override
|
||||
Future<RegistrationResult> register(AgentConfig config) async {
|
||||
return _onRegister(config);
|
||||
Future<EdgeAgentSession> openSession(AgentConfig config) async {
|
||||
final session = FakeEdgeAgentSession(_onRegister(config));
|
||||
lastSession = session;
|
||||
return session;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -54,6 +72,22 @@ runtime:
|
|||
});
|
||||
});
|
||||
|
||||
group('EdgeRegistrationClient.register one-shot', () {
|
||||
test('register returns session result and closes the session', () async {
|
||||
final fakeClient = FakeEdgeRegistrationClient((config) {
|
||||
return RegistrationResult.accepted(
|
||||
'node-123', 'alias-123', {'concurrency': 1});
|
||||
});
|
||||
|
||||
final result = await fakeClient.register(validConfig);
|
||||
|
||||
expect(result.accepted, isTrue);
|
||||
expect(result.nodeId, 'node-123');
|
||||
expect(fakeClient.lastSession, isNotNull);
|
||||
expect(fakeClient.lastSession!.closed, isTrue);
|
||||
});
|
||||
});
|
||||
|
||||
group('AgentRunner', () {
|
||||
test('AgentRunner maps config token to register request', () async {
|
||||
AgentConfig? capturedConfig;
|
||||
|
|
@ -63,24 +97,59 @@ runtime:
|
|||
'node-123', 'alias-123', {'concurrency': 1});
|
||||
});
|
||||
|
||||
final runner = DefaultAgentRunner(client: fakeClient, onLog: (msg) {});
|
||||
final runner = DefaultAgentRunner(
|
||||
client: fakeClient,
|
||||
onLog: (msg) {},
|
||||
waitForShutdown: () async {},
|
||||
);
|
||||
await runner.run(validConfig);
|
||||
|
||||
expect(capturedConfig, isNotNull);
|
||||
expect(capturedConfig!.agent.enrollmentToken, 'token-456');
|
||||
});
|
||||
|
||||
test('AgentRunner reports rejected registration', () async {
|
||||
test('AgentRunner keeps session open until shutdown then closes', () async {
|
||||
final fakeClient = FakeEdgeRegistrationClient((config) {
|
||||
return RegistrationResult.accepted(
|
||||
'node-123', 'alias-123', {'concurrency': 1});
|
||||
});
|
||||
|
||||
final shutdown = Completer<void>();
|
||||
final runner = DefaultAgentRunner(
|
||||
client: fakeClient,
|
||||
onLog: (msg) {},
|
||||
waitForShutdown: () => shutdown.future,
|
||||
);
|
||||
|
||||
final runFuture = runner.run(validConfig);
|
||||
// 종료 신호 전에는 session이 살아 있어야 한다.
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
expect(fakeClient.lastSession, isNotNull);
|
||||
expect(fakeClient.lastSession!.closed, isFalse);
|
||||
|
||||
shutdown.complete();
|
||||
await runFuture;
|
||||
expect(fakeClient.lastSession!.closed, isTrue);
|
||||
});
|
||||
|
||||
test('AgentRunner reports rejected registration and closes session',
|
||||
() async {
|
||||
final fakeClient = FakeEdgeRegistrationClient((config) {
|
||||
return RegistrationResult.rejected('Invalid token');
|
||||
});
|
||||
|
||||
final runner = DefaultAgentRunner(client: fakeClient, onLog: (msg) {});
|
||||
expect(
|
||||
final runner = DefaultAgentRunner(
|
||||
client: fakeClient,
|
||||
onLog: (msg) {},
|
||||
waitForShutdown: () async {},
|
||||
);
|
||||
await expectLater(
|
||||
() => runner.run(validConfig),
|
||||
throwsA(isA<RegistrationException>()
|
||||
.having((e) => e.message, 'message', 'Invalid token')),
|
||||
);
|
||||
expect(fakeClient.lastSession, isNotNull);
|
||||
expect(fakeClient.lastSession!.closed, isTrue);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,81 +10,140 @@ const _token = 'oto-smoke-token';
|
|||
const _nodeId = 'oto-smoke-node';
|
||||
const _nodeAlias = 'oto-smoke';
|
||||
|
||||
/// iop repo root used to run the Edge under test.
|
||||
///
|
||||
/// Defaults to the same-host sibling `../iop` checkout, but `IOP_REPO_ROOT`
|
||||
/// can override it so this smoke runs against any iop checkout (for example
|
||||
/// the `iop2oto` workspace clone).
|
||||
String _iopRepoRoot() {
|
||||
final override = Platform.environment['IOP_REPO_ROOT'];
|
||||
if (override != null && override.trim().isNotEmpty) {
|
||||
return override;
|
||||
}
|
||||
return '../iop';
|
||||
}
|
||||
|
||||
void main() {
|
||||
test('OTO Dart proto-socket client registers with iop Edge', () async {
|
||||
final edgePort = await _freePort();
|
||||
final metricsPort = await _freePort();
|
||||
final workDir = await Directory.systemTemp.createTemp('oto-iop-smoke-');
|
||||
final config = File('${workDir.path}/edge.yaml');
|
||||
await config
|
||||
.writeAsString(_edgeConfig(edgePort, metricsPort, workDir.path));
|
||||
test(
|
||||
'OTO Dart proto-socket client registers with iop Edge and goes online',
|
||||
() async {
|
||||
final iopRepoRoot = _iopRepoRoot();
|
||||
final edgePort = await _freePort();
|
||||
final metricsPort = await _freePort();
|
||||
final bootstrapPort = await _freePort();
|
||||
final workDir = await Directory.systemTemp.createTemp('oto-iop-smoke-');
|
||||
// Reuse a stable build cache across runs so the Edge `go run` stays warm
|
||||
// and a fresh checkout still completes its first cold build in time.
|
||||
final goCache = '${Directory.systemTemp.path}/oto-iop-smoke-gocache';
|
||||
// The Edge writes its application (zap) logs to this file, not stderr, so
|
||||
// the smoke tails it for the node.online lifecycle marker.
|
||||
final edgeLog = File('${workDir.path}/edge.log');
|
||||
final config = File('${workDir.path}/edge.yaml');
|
||||
await config.writeAsString(_edgeConfig(
|
||||
edgePort: edgePort,
|
||||
metricsPort: metricsPort,
|
||||
bootstrapPort: bootstrapPort,
|
||||
logPath: edgeLog.path,
|
||||
root: workDir.path,
|
||||
));
|
||||
|
||||
final edge = await Process.start(
|
||||
'go',
|
||||
[
|
||||
'run',
|
||||
'./apps/edge/cmd/edge',
|
||||
'serve',
|
||||
'--config',
|
||||
config.path,
|
||||
],
|
||||
workingDirectory: '../iop',
|
||||
environment: {
|
||||
'GOCACHE': '${workDir.path}/gocache',
|
||||
},
|
||||
);
|
||||
|
||||
final output = StringBuffer();
|
||||
final stdoutSub = edge.stdout
|
||||
.transform(systemEncoding.decoder)
|
||||
.listen(output.write, onError: output.write);
|
||||
final stderrSub = edge.stderr
|
||||
.transform(systemEncoding.decoder)
|
||||
.listen(output.write, onError: output.write);
|
||||
|
||||
try {
|
||||
await _waitForPort(_host, edgePort, edge, output);
|
||||
|
||||
final agentConfig = AgentConfig(
|
||||
agent: const AgentIdentityConfig(
|
||||
id: _nodeId,
|
||||
alias: _nodeAlias,
|
||||
enrollmentToken: _token,
|
||||
),
|
||||
edge: EdgeConnectionConfig(
|
||||
url: '$_host:$edgePort',
|
||||
),
|
||||
runtime: AgentRuntimeConfig(
|
||||
installDir: '${workDir.path}/install',
|
||||
workspaceRoot: '${workDir.path}/workspace',
|
||||
logDir: '${workDir.path}/log',
|
||||
),
|
||||
);
|
||||
|
||||
final client = EdgeRegistrationClient();
|
||||
final result = await client.register(agentConfig);
|
||||
|
||||
expect(result.accepted, isTrue);
|
||||
expect(result.nodeId, _nodeId);
|
||||
expect(result.alias, _nodeAlias);
|
||||
expect(result.runtimeConfig, isNotNull);
|
||||
expect(result.runtimeConfig!['concurrency'], 1);
|
||||
expect(
|
||||
result.runtimeConfig!['workspaceRoot'], '${workDir.path}/workspace');
|
||||
} finally {
|
||||
edge.kill(ProcessSignal.sigterm);
|
||||
await edge.exitCode.timeout(
|
||||
const Duration(seconds: 5),
|
||||
onTimeout: () {
|
||||
edge.kill(ProcessSignal.sigkill);
|
||||
return edge.exitCode;
|
||||
final edge = await Process.start(
|
||||
'go',
|
||||
[
|
||||
'run',
|
||||
'./apps/edge/cmd/edge',
|
||||
'serve',
|
||||
'--config',
|
||||
config.path,
|
||||
],
|
||||
workingDirectory: iopRepoRoot,
|
||||
environment: {
|
||||
'GOCACHE': goCache,
|
||||
},
|
||||
);
|
||||
await stdoutSub.cancel();
|
||||
await stderrSub.cancel();
|
||||
await workDir.delete(recursive: true);
|
||||
}
|
||||
}, timeout: const Timeout(Duration(seconds: 45)));
|
||||
|
||||
final output = StringBuffer();
|
||||
final stdoutSub = edge.stdout
|
||||
.transform(systemEncoding.decoder)
|
||||
.listen(output.write, onError: output.write);
|
||||
final stderrSub = edge.stderr
|
||||
.transform(systemEncoding.decoder)
|
||||
.listen(output.write, onError: output.write);
|
||||
|
||||
// ignore: avoid_print
|
||||
print('[oto-smoke] iop repo root: $iopRepoRoot');
|
||||
|
||||
EdgeAgentSession? session;
|
||||
try {
|
||||
await _waitForPort(_host, edgePort, edge, output);
|
||||
|
||||
final agentConfig = AgentConfig(
|
||||
agent: const AgentIdentityConfig(
|
||||
id: _nodeId,
|
||||
alias: _nodeAlias,
|
||||
enrollmentToken: _token,
|
||||
),
|
||||
edge: EdgeConnectionConfig(
|
||||
url: '$_host:$edgePort',
|
||||
),
|
||||
runtime: AgentRuntimeConfig(
|
||||
installDir: '${workDir.path}/install',
|
||||
workspaceRoot: '${workDir.path}/workspace',
|
||||
logDir: '${workDir.path}/log',
|
||||
),
|
||||
);
|
||||
|
||||
// openSession keeps the connection alive after registration so the
|
||||
// proto-socket heartbeat reaches the Edge and flips the node online.
|
||||
session = await EdgeRegistrationClient().openSession(agentConfig);
|
||||
final result = session.result;
|
||||
|
||||
expect(result.accepted, isTrue);
|
||||
expect(result.nodeId, _nodeId);
|
||||
expect(result.alias, _nodeAlias);
|
||||
expect(result.runtimeConfig, isNotNull);
|
||||
expect(result.runtimeConfig!['concurrency'], 1);
|
||||
expect(
|
||||
result.runtimeConfig!['workspaceRoot'],
|
||||
'${workDir.path}/workspace',
|
||||
);
|
||||
|
||||
// ignore: avoid_print
|
||||
print('[oto-smoke] registration accepted '
|
||||
'node=${result.nodeId} alias=${result.alias}');
|
||||
|
||||
// After accepted, wait for the Edge to record the first heartbeat and
|
||||
// transition the oto-agent node to online (node.online event). The
|
||||
// first heartbeat arrives on the proto-socket heartbeat interval
|
||||
// (~30s), so allow margin beyond it. The Edge emits this through its
|
||||
// application log file.
|
||||
final onlineLine = await _waitForLogMarker(
|
||||
'node.online',
|
||||
edgeLog,
|
||||
edge,
|
||||
output,
|
||||
const Duration(seconds: 60),
|
||||
);
|
||||
|
||||
// ignore: avoid_print
|
||||
print('[oto-smoke] online evidence: ${onlineLine.trim()}');
|
||||
} finally {
|
||||
await session?.close();
|
||||
edge.kill(ProcessSignal.sigterm);
|
||||
await edge.exitCode.timeout(
|
||||
const Duration(seconds: 5),
|
||||
onTimeout: () {
|
||||
edge.kill(ProcessSignal.sigkill);
|
||||
return edge.exitCode;
|
||||
},
|
||||
);
|
||||
await stdoutSub.cancel();
|
||||
await stderrSub.cancel();
|
||||
await workDir.delete(recursive: true);
|
||||
}
|
||||
},
|
||||
timeout: const Timeout(Duration(seconds: 180)),
|
||||
);
|
||||
}
|
||||
|
||||
Future<int> _freePort() async {
|
||||
|
|
@ -100,7 +159,8 @@ Future<void> _waitForPort(
|
|||
Process process,
|
||||
StringBuffer output,
|
||||
) async {
|
||||
final deadline = DateTime.now().add(const Duration(seconds: 20));
|
||||
// Generous deadline so a cold `go run` build of the Edge still finishes.
|
||||
final deadline = DateTime.now().add(const Duration(seconds: 120));
|
||||
while (DateTime.now().isBefore(deadline)) {
|
||||
final exit = await _tryExitCode(process);
|
||||
if (exit != null) {
|
||||
|
|
@ -121,6 +181,42 @@ Future<void> _waitForPort(
|
|||
fail('timed out waiting for iop Edge on $host:$port:\n$output');
|
||||
}
|
||||
|
||||
/// Polls the Edge [logFile] until [marker] appears and returns the matching
|
||||
/// log line. The captured process [output] (Fx/stderr) is only used for error
|
||||
/// context. Fails if the Edge exits early or the [timeout] elapses.
|
||||
Future<String> _waitForLogMarker(
|
||||
String marker,
|
||||
File logFile,
|
||||
Process process,
|
||||
StringBuffer output,
|
||||
Duration timeout,
|
||||
) async {
|
||||
final deadline = DateTime.now().add(timeout);
|
||||
while (DateTime.now().isBefore(deadline)) {
|
||||
if (logFile.existsSync()) {
|
||||
final text = logFile.readAsStringSync();
|
||||
final idx = text.indexOf(marker);
|
||||
if (idx >= 0) {
|
||||
final lineStart = text.lastIndexOf('\n', idx) + 1;
|
||||
var lineEnd = text.indexOf('\n', idx);
|
||||
if (lineEnd < 0) {
|
||||
lineEnd = text.length;
|
||||
}
|
||||
return text.substring(lineStart, lineEnd);
|
||||
}
|
||||
}
|
||||
final exit = await _tryExitCode(process);
|
||||
if (exit != null) {
|
||||
fail('iop Edge exited before "$marker" (code $exit):\n$output');
|
||||
}
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
}
|
||||
final logTail =
|
||||
logFile.existsSync() ? logFile.readAsStringSync() : '(no log)';
|
||||
fail('timed out waiting for "$marker" in Edge log:\n'
|
||||
'edge log:\n$logTail\nedge stderr:\n$output');
|
||||
}
|
||||
|
||||
Future<int?> _tryExitCode(Process process) {
|
||||
return process.exitCode
|
||||
.timeout(
|
||||
|
|
@ -130,7 +226,13 @@ Future<int?> _tryExitCode(Process process) {
|
|||
.then((code) => code == -1 ? null : code);
|
||||
}
|
||||
|
||||
String _edgeConfig(int edgePort, int metricsPort, String root) {
|
||||
String _edgeConfig({
|
||||
required int edgePort,
|
||||
required int metricsPort,
|
||||
required int bootstrapPort,
|
||||
required String logPath,
|
||||
required String root,
|
||||
}) {
|
||||
return '''
|
||||
edge:
|
||||
id: "oto-smoke-edge"
|
||||
|
|
@ -143,12 +245,16 @@ tls:
|
|||
enabled: false
|
||||
|
||||
logging:
|
||||
level: "error"
|
||||
level: "debug"
|
||||
pretty: false
|
||||
path: "$logPath"
|
||||
|
||||
metrics:
|
||||
port: $metricsPort
|
||||
|
||||
bootstrap:
|
||||
listen: "$_host:$bootstrapPort"
|
||||
|
||||
openai:
|
||||
enabled: false
|
||||
|
||||
|
|
@ -166,6 +272,7 @@ nodes:
|
|||
- id: "$_nodeId"
|
||||
alias: "$_nodeAlias"
|
||||
token: "$_token"
|
||||
agent_kind: "oto-agent"
|
||||
adapters:
|
||||
cli:
|
||||
enabled: false
|
||||
|
|
|
|||
|
|
@ -1,283 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
||||
|
||||
import 'struct.pbenum.dart';
|
||||
|
||||
export 'struct.pbenum.dart';
|
||||
|
||||
/// `Struct` represents a structured data value, consisting of fields
|
||||
/// which map to dynamically typed values. In some languages, `Struct`
|
||||
/// might be supported by a native representation. For example, in
|
||||
/// scripting languages like JS a struct is represented as an
|
||||
/// object. The details of that representation are described together
|
||||
/// with the proto support for the language.
|
||||
///
|
||||
/// The JSON representation for `Struct` is JSON object.
|
||||
class Struct extends $pb.GeneratedMessage with $mixin.StructMixin {
|
||||
factory Struct({
|
||||
$core.Map<$core.String, Value>? fields,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (fields != null) {
|
||||
$result.fields.addAll(fields);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
Struct._() : super();
|
||||
factory Struct.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Struct.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Struct', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.StructMixin.toProto3JsonHelper, fromProto3Json: $mixin.StructMixin.fromProto3JsonHelper)
|
||||
..m<$core.String, Value>(1, _omitFieldNames ? '' : 'fields', entryClassName: 'Struct.FieldsEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OM, valueCreator: Value.create, valueDefaultOrMaker: Value.getDefault, packageName: const $pb.PackageName('google.protobuf'))
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Struct clone() => Struct()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Struct copyWith(void Function(Struct) updates) => super.copyWith((message) => updates(message as Struct)) as Struct;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Struct create() => Struct._();
|
||||
Struct createEmptyInstance() => create();
|
||||
static $pb.PbList<Struct> createRepeated() => $pb.PbList<Struct>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Struct getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Struct>(create);
|
||||
static Struct? _defaultInstance;
|
||||
|
||||
/// Unordered map of dynamically typed values.
|
||||
@$pb.TagNumber(1)
|
||||
$core.Map<$core.String, Value> get fields => $_getMap(0);
|
||||
}
|
||||
|
||||
enum Value_Kind {
|
||||
nullValue,
|
||||
numberValue,
|
||||
stringValue,
|
||||
boolValue,
|
||||
structValue,
|
||||
listValue,
|
||||
notSet
|
||||
}
|
||||
|
||||
/// `Value` represents a dynamically typed value which can be either
|
||||
/// null, a number, a string, a boolean, a recursive struct value, or a
|
||||
/// list of values. A producer of value is expected to set one of these
|
||||
/// variants. Absence of any variant indicates an error.
|
||||
///
|
||||
/// The JSON representation for `Value` is JSON value.
|
||||
class Value extends $pb.GeneratedMessage with $mixin.ValueMixin {
|
||||
factory Value({
|
||||
NullValue? nullValue,
|
||||
$core.double? numberValue,
|
||||
$core.String? stringValue,
|
||||
$core.bool? boolValue,
|
||||
Struct? structValue,
|
||||
ListValue? listValue,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (nullValue != null) {
|
||||
$result.nullValue = nullValue;
|
||||
}
|
||||
if (numberValue != null) {
|
||||
$result.numberValue = numberValue;
|
||||
}
|
||||
if (stringValue != null) {
|
||||
$result.stringValue = stringValue;
|
||||
}
|
||||
if (boolValue != null) {
|
||||
$result.boolValue = boolValue;
|
||||
}
|
||||
if (structValue != null) {
|
||||
$result.structValue = structValue;
|
||||
}
|
||||
if (listValue != null) {
|
||||
$result.listValue = listValue;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
Value._() : super();
|
||||
factory Value.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Value.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static const $core.Map<$core.int, Value_Kind> _Value_KindByTag = {
|
||||
1 : Value_Kind.nullValue,
|
||||
2 : Value_Kind.numberValue,
|
||||
3 : Value_Kind.stringValue,
|
||||
4 : Value_Kind.boolValue,
|
||||
5 : Value_Kind.structValue,
|
||||
6 : Value_Kind.listValue,
|
||||
0 : Value_Kind.notSet
|
||||
};
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Value', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.ValueMixin.toProto3JsonHelper, fromProto3Json: $mixin.ValueMixin.fromProto3JsonHelper)
|
||||
..oo(0, [1, 2, 3, 4, 5, 6])
|
||||
..e<NullValue>(1, _omitFieldNames ? '' : 'nullValue', $pb.PbFieldType.OE, defaultOrMaker: NullValue.NULL_VALUE, valueOf: NullValue.valueOf, enumValues: NullValue.values)
|
||||
..a<$core.double>(2, _omitFieldNames ? '' : 'numberValue', $pb.PbFieldType.OD)
|
||||
..aOS(3, _omitFieldNames ? '' : 'stringValue')
|
||||
..aOB(4, _omitFieldNames ? '' : 'boolValue')
|
||||
..aOM<Struct>(5, _omitFieldNames ? '' : 'structValue', subBuilder: Struct.create)
|
||||
..aOM<ListValue>(6, _omitFieldNames ? '' : 'listValue', subBuilder: ListValue.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Value clone() => Value()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Value copyWith(void Function(Value) updates) => super.copyWith((message) => updates(message as Value)) as Value;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Value create() => Value._();
|
||||
Value createEmptyInstance() => create();
|
||||
static $pb.PbList<Value> createRepeated() => $pb.PbList<Value>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Value getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Value>(create);
|
||||
static Value? _defaultInstance;
|
||||
|
||||
Value_Kind whichKind() => _Value_KindByTag[$_whichOneof(0)]!;
|
||||
void clearKind() => clearField($_whichOneof(0));
|
||||
|
||||
/// Represents a null value.
|
||||
@$pb.TagNumber(1)
|
||||
NullValue get nullValue => $_getN(0);
|
||||
@$pb.TagNumber(1)
|
||||
set nullValue(NullValue v) { setField(1, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasNullValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearNullValue() => clearField(1);
|
||||
|
||||
/// Represents a double value.
|
||||
@$pb.TagNumber(2)
|
||||
$core.double get numberValue => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set numberValue($core.double v) { $_setDouble(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasNumberValue() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearNumberValue() => clearField(2);
|
||||
|
||||
/// Represents a string value.
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get stringValue => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set stringValue($core.String v) { $_setString(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasStringValue() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearStringValue() => clearField(3);
|
||||
|
||||
/// Represents a boolean value.
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool get boolValue => $_getBF(3);
|
||||
@$pb.TagNumber(4)
|
||||
set boolValue($core.bool v) { $_setBool(3, v); }
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasBoolValue() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearBoolValue() => clearField(4);
|
||||
|
||||
/// Represents a structured value.
|
||||
@$pb.TagNumber(5)
|
||||
Struct get structValue => $_getN(4);
|
||||
@$pb.TagNumber(5)
|
||||
set structValue(Struct v) { setField(5, v); }
|
||||
@$pb.TagNumber(5)
|
||||
$core.bool hasStructValue() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearStructValue() => clearField(5);
|
||||
@$pb.TagNumber(5)
|
||||
Struct ensureStructValue() => $_ensure(4);
|
||||
|
||||
/// Represents a repeated `Value`.
|
||||
@$pb.TagNumber(6)
|
||||
ListValue get listValue => $_getN(5);
|
||||
@$pb.TagNumber(6)
|
||||
set listValue(ListValue v) { setField(6, v); }
|
||||
@$pb.TagNumber(6)
|
||||
$core.bool hasListValue() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
void clearListValue() => clearField(6);
|
||||
@$pb.TagNumber(6)
|
||||
ListValue ensureListValue() => $_ensure(5);
|
||||
}
|
||||
|
||||
/// `ListValue` is a wrapper around a repeated field of values.
|
||||
///
|
||||
/// The JSON representation for `ListValue` is JSON array.
|
||||
class ListValue extends $pb.GeneratedMessage with $mixin.ListValueMixin {
|
||||
factory ListValue({
|
||||
$core.Iterable<Value>? values,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (values != null) {
|
||||
$result.values.addAll(values);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
ListValue._() : super();
|
||||
factory ListValue.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory ListValue.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ListValue', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.ListValueMixin.toProto3JsonHelper, fromProto3Json: $mixin.ListValueMixin.fromProto3JsonHelper)
|
||||
..pc<Value>(1, _omitFieldNames ? '' : 'values', $pb.PbFieldType.PM, subBuilder: Value.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
ListValue clone() => ListValue()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ListValue copyWith(void Function(ListValue) updates) => super.copyWith((message) => updates(message as ListValue)) as ListValue;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ListValue create() => ListValue._();
|
||||
ListValue createEmptyInstance() => create();
|
||||
static $pb.PbList<ListValue> createRepeated() => $pb.PbList<ListValue>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ListValue getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ListValue>(create);
|
||||
static ListValue? _defaultInstance;
|
||||
|
||||
/// Repeated field of dynamically typed values.
|
||||
@$pb.TagNumber(1)
|
||||
$core.List<Value> get values => $_getList(0);
|
||||
}
|
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// `NullValue` is a singleton enumeration to represent the null value for the
|
||||
/// `Value` type union.
|
||||
///
|
||||
/// The JSON representation for `NullValue` is JSON `null`.
|
||||
class NullValue extends $pb.ProtobufEnum {
|
||||
static const NullValue NULL_VALUE = NullValue._(0, _omitEnumNames ? '' : 'NULL_VALUE');
|
||||
|
||||
static const $core.List<NullValue> values = <NullValue> [
|
||||
NULL_VALUE,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, NullValue> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static NullValue? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const NullValue._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use nullValueDescriptor instead')
|
||||
const NullValue$json = {
|
||||
'1': 'NullValue',
|
||||
'2': [
|
||||
{'1': 'NULL_VALUE', '2': 0},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NullValue`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List nullValueDescriptor = $convert.base64Decode(
|
||||
'CglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAA');
|
||||
|
||||
@$core.Deprecated('Use structDescriptor instead')
|
||||
const Struct$json = {
|
||||
'1': 'Struct',
|
||||
'2': [
|
||||
{'1': 'fields', '3': 1, '4': 3, '5': 11, '6': '.google.protobuf.Struct.FieldsEntry', '10': 'fields'},
|
||||
],
|
||||
'3': [Struct_FieldsEntry$json],
|
||||
};
|
||||
|
||||
@$core.Deprecated('Use structDescriptor instead')
|
||||
const Struct_FieldsEntry$json = {
|
||||
'1': 'FieldsEntry',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.google.protobuf.Value', '10': 'value'},
|
||||
],
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
/// Descriptor for `Struct`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List structDescriptor = $convert.base64Decode(
|
||||
'CgZTdHJ1Y3QSOwoGZmllbGRzGAEgAygLMiMuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdC5GaWVsZH'
|
||||
'NFbnRyeVIGZmllbGRzGlEKC0ZpZWxkc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EiwKBXZhbHVl'
|
||||
'GAIgASgLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgV2YWx1ZToCOAE=');
|
||||
|
||||
@$core.Deprecated('Use valueDescriptor instead')
|
||||
const Value$json = {
|
||||
'1': 'Value',
|
||||
'2': [
|
||||
{'1': 'null_value', '3': 1, '4': 1, '5': 14, '6': '.google.protobuf.NullValue', '9': 0, '10': 'nullValue'},
|
||||
{'1': 'number_value', '3': 2, '4': 1, '5': 1, '9': 0, '10': 'numberValue'},
|
||||
{'1': 'string_value', '3': 3, '4': 1, '5': 9, '9': 0, '10': 'stringValue'},
|
||||
{'1': 'bool_value', '3': 4, '4': 1, '5': 8, '9': 0, '10': 'boolValue'},
|
||||
{'1': 'struct_value', '3': 5, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '9': 0, '10': 'structValue'},
|
||||
{'1': 'list_value', '3': 6, '4': 1, '5': 11, '6': '.google.protobuf.ListValue', '9': 0, '10': 'listValue'},
|
||||
],
|
||||
'8': [
|
||||
{'1': 'kind'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Value`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List valueDescriptor = $convert.base64Decode(
|
||||
'CgVWYWx1ZRI7CgpudWxsX3ZhbHVlGAEgASgOMhouZ29vZ2xlLnByb3RvYnVmLk51bGxWYWx1ZU'
|
||||
'gAUgludWxsVmFsdWUSIwoMbnVtYmVyX3ZhbHVlGAIgASgBSABSC251bWJlclZhbHVlEiMKDHN0'
|
||||
'cmluZ192YWx1ZRgDIAEoCUgAUgtzdHJpbmdWYWx1ZRIfCgpib29sX3ZhbHVlGAQgASgISABSCW'
|
||||
'Jvb2xWYWx1ZRI8CgxzdHJ1Y3RfdmFsdWUYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0'
|
||||
'SABSC3N0cnVjdFZhbHVlEjsKCmxpc3RfdmFsdWUYBiABKAsyGi5nb29nbGUucHJvdG9idWYuTG'
|
||||
'lzdFZhbHVlSABSCWxpc3RWYWx1ZUIGCgRraW5k');
|
||||
|
||||
@$core.Deprecated('Use listValueDescriptor instead')
|
||||
const ListValue$json = {
|
||||
'1': 'ListValue',
|
||||
'2': [
|
||||
{'1': 'values', '3': 1, '4': 3, '5': 11, '6': '.google.protobuf.Value', '10': 'values'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ListValue`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listValueDescriptor = $convert.base64Decode(
|
||||
'CglMaXN0VmFsdWUSLgoGdmFsdWVzGAEgAygLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgZ2YW'
|
||||
'x1ZXM=');
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
export 'struct.pb.dart';
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,72 +1,100 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: iop/runtime.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// Generated from iop/runtime.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class RunSessionMode extends $pb.ProtobufEnum {
|
||||
static const RunSessionMode RUN_SESSION_MODE_UNSPECIFIED = RunSessionMode._(0, _omitEnumNames ? '' : 'RUN_SESSION_MODE_UNSPECIFIED');
|
||||
static const RunSessionMode RUN_SESSION_MODE_CREATE_IF_MISSING = RunSessionMode._(1, _omitEnumNames ? '' : 'RUN_SESSION_MODE_CREATE_IF_MISSING');
|
||||
static const RunSessionMode RUN_SESSION_MODE_REQUIRE_EXISTING = RunSessionMode._(2, _omitEnumNames ? '' : 'RUN_SESSION_MODE_REQUIRE_EXISTING');
|
||||
static const RunSessionMode RUN_SESSION_MODE_UNSPECIFIED =
|
||||
RunSessionMode._(0, _omitEnumNames ? '' : 'RUN_SESSION_MODE_UNSPECIFIED');
|
||||
static const RunSessionMode RUN_SESSION_MODE_CREATE_IF_MISSING =
|
||||
RunSessionMode._(
|
||||
1, _omitEnumNames ? '' : 'RUN_SESSION_MODE_CREATE_IF_MISSING');
|
||||
static const RunSessionMode RUN_SESSION_MODE_REQUIRE_EXISTING =
|
||||
RunSessionMode._(
|
||||
2, _omitEnumNames ? '' : 'RUN_SESSION_MODE_REQUIRE_EXISTING');
|
||||
|
||||
static const $core.List<RunSessionMode> values = <RunSessionMode> [
|
||||
static const $core.List<RunSessionMode> values = <RunSessionMode>[
|
||||
RUN_SESSION_MODE_UNSPECIFIED,
|
||||
RUN_SESSION_MODE_CREATE_IF_MISSING,
|
||||
RUN_SESSION_MODE_REQUIRE_EXISTING,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, RunSessionMode> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static RunSessionMode? valueOf($core.int value) => _byValue[value];
|
||||
static final $core.List<RunSessionMode?> _byValue =
|
||||
$pb.ProtobufEnum.$_initByValueList(values, 2);
|
||||
static RunSessionMode? valueOf($core.int value) =>
|
||||
value < 0 || value >= _byValue.length ? null : _byValue[value];
|
||||
|
||||
const RunSessionMode._($core.int v, $core.String n) : super(v, n);
|
||||
const RunSessionMode._(super.value, super.name);
|
||||
}
|
||||
|
||||
class CancelAction extends $pb.ProtobufEnum {
|
||||
static const CancelAction CANCEL_ACTION_UNSPECIFIED = CancelAction._(0, _omitEnumNames ? '' : 'CANCEL_ACTION_UNSPECIFIED');
|
||||
static const CancelAction CANCEL_ACTION_CANCEL_RUN = CancelAction._(1, _omitEnumNames ? '' : 'CANCEL_ACTION_CANCEL_RUN');
|
||||
static const CancelAction CANCEL_ACTION_TERMINATE_SESSION = CancelAction._(2, _omitEnumNames ? '' : 'CANCEL_ACTION_TERMINATE_SESSION');
|
||||
static const CancelAction CANCEL_ACTION_UNSPECIFIED =
|
||||
CancelAction._(0, _omitEnumNames ? '' : 'CANCEL_ACTION_UNSPECIFIED');
|
||||
static const CancelAction CANCEL_ACTION_CANCEL_RUN =
|
||||
CancelAction._(1, _omitEnumNames ? '' : 'CANCEL_ACTION_CANCEL_RUN');
|
||||
static const CancelAction CANCEL_ACTION_TERMINATE_SESSION = CancelAction._(
|
||||
2, _omitEnumNames ? '' : 'CANCEL_ACTION_TERMINATE_SESSION');
|
||||
|
||||
static const $core.List<CancelAction> values = <CancelAction> [
|
||||
static const $core.List<CancelAction> values = <CancelAction>[
|
||||
CANCEL_ACTION_UNSPECIFIED,
|
||||
CANCEL_ACTION_CANCEL_RUN,
|
||||
CANCEL_ACTION_TERMINATE_SESSION,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, CancelAction> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static CancelAction? valueOf($core.int value) => _byValue[value];
|
||||
static final $core.List<CancelAction?> _byValue =
|
||||
$pb.ProtobufEnum.$_initByValueList(values, 2);
|
||||
static CancelAction? valueOf($core.int value) =>
|
||||
value < 0 || value >= _byValue.length ? null : _byValue[value];
|
||||
|
||||
const CancelAction._($core.int v, $core.String n) : super(v, n);
|
||||
const CancelAction._(super.value, super.name);
|
||||
}
|
||||
|
||||
class NodeCommandType extends $pb.ProtobufEnum {
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_UNSPECIFIED = NodeCommandType._(0, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_UNSPECIFIED');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_USAGE_STATUS = NodeCommandType._(1, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_USAGE_STATUS');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_CAPABILITIES = NodeCommandType._(2, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_CAPABILITIES');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_SESSION_LIST = NodeCommandType._(3, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_SESSION_LIST');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_TRANSPORT_STATUS = NodeCommandType._(4, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_TRANSPORT_STATUS');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_UNSPECIFIED =
|
||||
NodeCommandType._(
|
||||
0, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_UNSPECIFIED');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_USAGE_STATUS =
|
||||
NodeCommandType._(
|
||||
1, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_USAGE_STATUS');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_CAPABILITIES =
|
||||
NodeCommandType._(
|
||||
2, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_CAPABILITIES');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_SESSION_LIST =
|
||||
NodeCommandType._(
|
||||
3, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_SESSION_LIST');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_TRANSPORT_STATUS =
|
||||
NodeCommandType._(
|
||||
4, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_TRANSPORT_STATUS');
|
||||
static const NodeCommandType NODE_COMMAND_TYPE_OLLAMA_API = NodeCommandType._(
|
||||
5, _omitEnumNames ? '' : 'NODE_COMMAND_TYPE_OLLAMA_API');
|
||||
|
||||
static const $core.List<NodeCommandType> values = <NodeCommandType> [
|
||||
static const $core.List<NodeCommandType> values = <NodeCommandType>[
|
||||
NODE_COMMAND_TYPE_UNSPECIFIED,
|
||||
NODE_COMMAND_TYPE_USAGE_STATUS,
|
||||
NODE_COMMAND_TYPE_CAPABILITIES,
|
||||
NODE_COMMAND_TYPE_SESSION_LIST,
|
||||
NODE_COMMAND_TYPE_TRANSPORT_STATUS,
|
||||
NODE_COMMAND_TYPE_OLLAMA_API,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, NodeCommandType> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static NodeCommandType? valueOf($core.int value) => _byValue[value];
|
||||
static final $core.List<NodeCommandType?> _byValue =
|
||||
$pb.ProtobufEnum.$_initByValueList(values, 5);
|
||||
static NodeCommandType? valueOf($core.int value) =>
|
||||
value < 0 || value >= _byValue.length ? null : _byValue[value];
|
||||
|
||||
const NodeCommandType._($core.int v, $core.String n) : super(v, n);
|
||||
const NodeCommandType._(super.value, super.name);
|
||||
}
|
||||
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
const $core.bool _omitEnumNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: iop/runtime.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// Generated from iop/runtime.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
|
|
@ -54,6 +56,7 @@ const NodeCommandType$json = {
|
|||
{'1': 'NODE_COMMAND_TYPE_CAPABILITIES', '2': 2},
|
||||
{'1': 'NODE_COMMAND_TYPE_SESSION_LIST', '2': 3},
|
||||
{'1': 'NODE_COMMAND_TYPE_TRANSPORT_STATUS', '2': 4},
|
||||
{'1': 'NODE_COMMAND_TYPE_OLLAMA_API', '2': 5},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -62,7 +65,8 @@ final $typed_data.Uint8List nodeCommandTypeDescriptor = $convert.base64Decode(
|
|||
'Cg9Ob2RlQ29tbWFuZFR5cGUSIQodTk9ERV9DT01NQU5EX1RZUEVfVU5TUEVDSUZJRUQQABIiCh'
|
||||
'5OT0RFX0NPTU1BTkRfVFlQRV9VU0FHRV9TVEFUVVMQARIiCh5OT0RFX0NPTU1BTkRfVFlQRV9D'
|
||||
'QVBBQklMSVRJRVMQAhIiCh5OT0RFX0NPTU1BTkRfVFlQRV9TRVNTSU9OX0xJU1QQAxImCiJOT0'
|
||||
'RFX0NPTU1BTkRfVFlQRV9UUkFOU1BPUlRfU1RBVFVTEAQ=');
|
||||
'RFX0NPTU1BTkRfVFlQRV9UUkFOU1BPUlRfU1RBVFVTEAQSIAocTk9ERV9DT01NQU5EX1RZUEVf'
|
||||
'T0xMQU1BX0FQSRAF');
|
||||
|
||||
@$core.Deprecated('Use runRequestDescriptor instead')
|
||||
const RunRequest$json = {
|
||||
|
|
@ -72,12 +76,40 @@ const RunRequest$json = {
|
|||
{'1': 'adapter', '3': 2, '4': 1, '5': 9, '10': 'adapter'},
|
||||
{'1': 'target', '3': 3, '4': 1, '5': 9, '10': 'target'},
|
||||
{'1': 'workspace', '3': 4, '4': 1, '5': 9, '10': 'workspace'},
|
||||
{'1': 'policy', '3': 5, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '10': 'policy'},
|
||||
{'1': 'input', '3': 6, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '10': 'input'},
|
||||
{
|
||||
'1': 'policy',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Struct',
|
||||
'10': 'policy'
|
||||
},
|
||||
{
|
||||
'1': 'input',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Struct',
|
||||
'10': 'input'
|
||||
},
|
||||
{'1': 'timeout_sec', '3': 7, '4': 1, '5': 5, '10': 'timeoutSec'},
|
||||
{'1': 'metadata', '3': 8, '4': 3, '5': 11, '6': '.iop.RunRequest.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 8,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.RunRequest.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
{'1': 'session_id', '3': 9, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'session_mode', '3': 10, '4': 1, '5': 14, '6': '.iop.RunSessionMode', '10': 'sessionMode'},
|
||||
{
|
||||
'1': 'session_mode',
|
||||
'3': 10,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.iop.RunSessionMode',
|
||||
'10': 'sessionMode'
|
||||
},
|
||||
{'1': 'background', '3': 11, '4': 1, '5': 8, '10': 'background'},
|
||||
],
|
||||
'3': [RunRequest_MetadataEntry$json],
|
||||
|
|
@ -115,7 +147,14 @@ const RunEvent$json = {
|
|||
{'1': 'message', '3': 4, '4': 1, '5': 9, '10': 'message'},
|
||||
{'1': 'error', '3': 5, '4': 1, '5': 9, '10': 'error'},
|
||||
{'1': 'usage', '3': 6, '4': 1, '5': 11, '6': '.iop.Usage', '10': 'usage'},
|
||||
{'1': 'metadata', '3': 7, '4': 3, '5': 11, '6': '.iop.RunEvent.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 7,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.RunEvent.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
{'1': 'timestamp', '3': 8, '4': 1, '5': 3, '10': 'timestamp'},
|
||||
{'1': 'session_id', '3': 9, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'background', '3': 10, '4': 1, '5': 8, '10': 'background'},
|
||||
|
|
@ -156,7 +195,14 @@ const EdgeNodeEvent$json = {
|
|||
{'1': 'node_id', '3': 4, '4': 1, '5': 9, '10': 'nodeId'},
|
||||
{'1': 'alias', '3': 5, '4': 1, '5': 9, '10': 'alias'},
|
||||
{'1': 'reason', '3': 6, '4': 1, '5': 9, '10': 'reason'},
|
||||
{'1': 'metadata', '3': 7, '4': 3, '5': 11, '6': '.iop.EdgeNodeEvent.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 7,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.EdgeNodeEvent.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
{'1': 'timestamp', '3': 8, '4': 1, '5': 3, '10': 'timestamp'},
|
||||
],
|
||||
'3': [EdgeNodeEvent_MetadataEntry$json],
|
||||
|
|
@ -204,8 +250,8 @@ const Heartbeat$json = {
|
|||
};
|
||||
|
||||
/// Descriptor for `Heartbeat`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List heartbeatDescriptor = $convert.base64Decode(
|
||||
'CglIZWFydGJlYXQSHAoJdGltZXN0YW1wGAEgASgDUgl0aW1lc3RhbXA=');
|
||||
final $typed_data.Uint8List heartbeatDescriptor = $convert
|
||||
.base64Decode('CglIZWFydGJlYXQSHAoJdGltZXN0YW1wGAEgASgDUgl0aW1lc3RhbXA=');
|
||||
|
||||
@$core.Deprecated('Use cancelRequestDescriptor instead')
|
||||
const CancelRequest$json = {
|
||||
|
|
@ -215,7 +261,14 @@ const CancelRequest$json = {
|
|||
{'1': 'adapter', '3': 2, '4': 1, '5': 9, '10': 'adapter'},
|
||||
{'1': 'target', '3': 3, '4': 1, '5': 9, '10': 'target'},
|
||||
{'1': 'session_id', '3': 4, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'action', '3': 5, '4': 1, '5': 14, '6': '.iop.CancelAction', '10': 'action'},
|
||||
{
|
||||
'1': 'action',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.iop.CancelAction',
|
||||
'10': 'action'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -230,12 +283,26 @@ const NodeCommandRequest$json = {
|
|||
'1': 'NodeCommandRequest',
|
||||
'2': [
|
||||
{'1': 'request_id', '3': 1, '4': 1, '5': 9, '10': 'requestId'},
|
||||
{'1': 'type', '3': 2, '4': 1, '5': 14, '6': '.iop.NodeCommandType', '10': 'type'},
|
||||
{
|
||||
'1': 'type',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.iop.NodeCommandType',
|
||||
'10': 'type'
|
||||
},
|
||||
{'1': 'adapter', '3': 3, '4': 1, '5': 9, '10': 'adapter'},
|
||||
{'1': 'target', '3': 4, '4': 1, '5': 9, '10': 'target'},
|
||||
{'1': 'session_id', '3': 5, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'timeout_sec', '3': 6, '4': 1, '5': 5, '10': 'timeoutSec'},
|
||||
{'1': 'metadata', '3': 7, '4': 3, '5': 11, '6': '.iop.NodeCommandRequest.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 7,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.NodeCommandRequest.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
],
|
||||
'3': [NodeCommandRequest_MetadataEntry$json],
|
||||
};
|
||||
|
|
@ -265,13 +332,34 @@ const NodeCommandResponse$json = {
|
|||
'1': 'NodeCommandResponse',
|
||||
'2': [
|
||||
{'1': 'request_id', '3': 1, '4': 1, '5': 9, '10': 'requestId'},
|
||||
{'1': 'type', '3': 2, '4': 1, '5': 14, '6': '.iop.NodeCommandType', '10': 'type'},
|
||||
{
|
||||
'1': 'type',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.iop.NodeCommandType',
|
||||
'10': 'type'
|
||||
},
|
||||
{'1': 'adapter', '3': 3, '4': 1, '5': 9, '10': 'adapter'},
|
||||
{'1': 'target', '3': 4, '4': 1, '5': 9, '10': 'target'},
|
||||
{'1': 'session_id', '3': 5, '4': 1, '5': 9, '10': 'sessionId'},
|
||||
{'1': 'usage_status', '3': 6, '4': 1, '5': 11, '6': '.iop.AgentUsageStatus', '10': 'usageStatus'},
|
||||
{
|
||||
'1': 'usage_status',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.AgentUsageStatus',
|
||||
'10': 'usageStatus'
|
||||
},
|
||||
{'1': 'error', '3': 7, '4': 1, '5': 9, '10': 'error'},
|
||||
{'1': 'result', '3': 8, '4': 3, '5': 11, '6': '.iop.NodeCommandResponse.ResultEntry', '10': 'result'},
|
||||
{
|
||||
'1': 'result',
|
||||
'3': 8,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.NodeCommandResponse.ResultEntry',
|
||||
'10': 'result'
|
||||
},
|
||||
],
|
||||
'3': [NodeCommandResponse_ResultEntry$json],
|
||||
};
|
||||
|
|
@ -305,7 +393,14 @@ const AgentUsageStatus$json = {
|
|||
{'1': 'daily_reset_time', '3': 3, '4': 1, '5': 9, '10': 'dailyResetTime'},
|
||||
{'1': 'weekly_limit', '3': 4, '4': 1, '5': 9, '10': 'weeklyLimit'},
|
||||
{'1': 'weekly_reset_time', '3': 5, '4': 1, '5': 9, '10': 'weeklyResetTime'},
|
||||
{'1': 'metadata', '3': 6, '4': 3, '5': 11, '6': '.iop.AgentUsageStatus.MetadataEntry', '10': 'metadata'},
|
||||
{
|
||||
'1': 'metadata',
|
||||
'3': 6,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.AgentUsageStatus.MetadataEntry',
|
||||
'10': 'metadata'
|
||||
},
|
||||
],
|
||||
'3': [AgentUsageStatus_MetadataEntry$json],
|
||||
};
|
||||
|
|
@ -351,8 +446,8 @@ const RegisterRequest$json = {
|
|||
};
|
||||
|
||||
/// Descriptor for `RegisterRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List registerRequestDescriptor = $convert.base64Decode(
|
||||
'Cg9SZWdpc3RlclJlcXVlc3QSFAoFdG9rZW4YASABKAlSBXRva2Vu');
|
||||
final $typed_data.Uint8List registerRequestDescriptor = $convert
|
||||
.base64Decode('Cg9SZWdpc3RlclJlcXVlc3QSFAoFdG9rZW4YASABKAlSBXRva2Vu');
|
||||
|
||||
@$core.Deprecated('Use registerResponseDescriptor instead')
|
||||
const RegisterResponse$json = {
|
||||
|
|
@ -362,7 +457,14 @@ const RegisterResponse$json = {
|
|||
{'1': 'node_id', '3': 2, '4': 1, '5': 9, '10': 'nodeId'},
|
||||
{'1': 'alias', '3': 3, '4': 1, '5': 9, '10': 'alias'},
|
||||
{'1': 'reason', '3': 4, '4': 1, '5': 9, '10': 'reason'},
|
||||
{'1': 'config', '3': 5, '4': 1, '5': 11, '6': '.iop.NodeConfigPayload', '10': 'config'},
|
||||
{
|
||||
'1': 'config',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.NodeConfigPayload',
|
||||
'10': 'config'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -376,8 +478,22 @@ final $typed_data.Uint8List registerResponseDescriptor = $convert.base64Decode(
|
|||
const NodeConfigPayload$json = {
|
||||
'1': 'NodeConfigPayload',
|
||||
'2': [
|
||||
{'1': 'adapters', '3': 1, '4': 3, '5': 11, '6': '.iop.AdapterConfig', '10': 'adapters'},
|
||||
{'1': 'runtime', '3': 2, '4': 1, '5': 11, '6': '.iop.NodeRuntimeConfig', '10': 'runtime'},
|
||||
{
|
||||
'1': 'adapters',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.AdapterConfig',
|
||||
'10': 'adapters'
|
||||
},
|
||||
{
|
||||
'1': 'runtime',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.NodeRuntimeConfig',
|
||||
'10': 'runtime'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -393,10 +509,41 @@ const AdapterConfig$json = {
|
|||
'2': [
|
||||
{'1': 'type', '3': 1, '4': 1, '5': 9, '10': 'type'},
|
||||
{'1': 'enabled', '3': 2, '4': 1, '5': 8, '10': 'enabled'},
|
||||
{'1': 'settings', '3': 3, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '10': 'settings'},
|
||||
{'1': 'cli', '3': 4, '4': 1, '5': 11, '6': '.iop.CLIAdapterConfig', '9': 0, '10': 'cli'},
|
||||
{'1': 'ollama', '3': 5, '4': 1, '5': 11, '6': '.iop.OllamaAdapterConfig', '9': 0, '10': 'ollama'},
|
||||
{'1': 'vllm', '3': 6, '4': 1, '5': 11, '6': '.iop.VllmAdapterConfig', '9': 0, '10': 'vllm'},
|
||||
{
|
||||
'1': 'settings',
|
||||
'3': 3,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Struct',
|
||||
'10': 'settings'
|
||||
},
|
||||
{
|
||||
'1': 'cli',
|
||||
'3': 4,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.CLIAdapterConfig',
|
||||
'9': 0,
|
||||
'10': 'cli'
|
||||
},
|
||||
{
|
||||
'1': 'ollama',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.OllamaAdapterConfig',
|
||||
'9': 0,
|
||||
'10': 'ollama'
|
||||
},
|
||||
{
|
||||
'1': 'vllm',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.VllmAdapterConfig',
|
||||
'9': 0,
|
||||
'10': 'vllm'
|
||||
},
|
||||
],
|
||||
'8': [
|
||||
{'1': 'config'},
|
||||
|
|
@ -415,7 +562,14 @@ final $typed_data.Uint8List adapterConfigDescriptor = $convert.base64Decode(
|
|||
const CLIAdapterConfig$json = {
|
||||
'1': 'CLIAdapterConfig',
|
||||
'2': [
|
||||
{'1': 'profiles', '3': 1, '4': 3, '5': 11, '6': '.iop.CLIAdapterConfig.ProfilesEntry', '10': 'profiles'},
|
||||
{
|
||||
'1': 'profiles',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.iop.CLIAdapterConfig.ProfilesEntry',
|
||||
'10': 'profiles'
|
||||
},
|
||||
],
|
||||
'3': [CLIAdapterConfig_ProfilesEntry$json],
|
||||
};
|
||||
|
|
@ -425,7 +579,14 @@ const CLIAdapterConfig_ProfilesEntry$json = {
|
|||
'1': 'ProfilesEntry',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.iop.CLIProfileConfig', '10': 'value'},
|
||||
{
|
||||
'1': 'value',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.CLIProfileConfig',
|
||||
'10': 'value'
|
||||
},
|
||||
],
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
|
@ -446,10 +607,29 @@ const CLIProfileConfig$json = {
|
|||
{'1': 'env', '3': 3, '4': 3, '5': 9, '10': 'env'},
|
||||
{'1': 'persistent', '3': 4, '4': 1, '5': 8, '10': 'persistent'},
|
||||
{'1': 'terminal', '3': 5, '4': 1, '5': 8, '10': 'terminal'},
|
||||
{'1': 'response_idle_timeout_ms', '3': 6, '4': 1, '5': 5, '10': 'responseIdleTimeoutMs'},
|
||||
{'1': 'startup_idle_timeout_ms', '3': 7, '4': 1, '5': 5, '10': 'startupIdleTimeoutMs'},
|
||||
{
|
||||
'1': 'response_idle_timeout_ms',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
'5': 5,
|
||||
'10': 'responseIdleTimeoutMs'
|
||||
},
|
||||
{
|
||||
'1': 'startup_idle_timeout_ms',
|
||||
'3': 7,
|
||||
'4': 1,
|
||||
'5': 5,
|
||||
'10': 'startupIdleTimeoutMs'
|
||||
},
|
||||
{'1': 'output_format', '3': 8, '4': 1, '5': 9, '10': 'outputFormat'},
|
||||
{'1': 'completion_marker', '3': 9, '4': 1, '5': 11, '6': '.iop.CLICompletionMarker', '10': 'completionMarker'},
|
||||
{
|
||||
'1': 'completion_marker',
|
||||
'3': 9,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.iop.CLICompletionMarker',
|
||||
'10': 'completionMarker'
|
||||
},
|
||||
{'1': 'mode', '3': 10, '4': 1, '5': 9, '10': 'mode'},
|
||||
{'1': 'resume_args', '3': 11, '4': 3, '5': 9, '10': 'resumeArgs'},
|
||||
],
|
||||
|
|
@ -519,4 +699,3 @@ const NodeRuntimeConfig$json = {
|
|||
final $typed_data.Uint8List nodeRuntimeConfigDescriptor = $convert.base64Decode(
|
||||
'ChFOb2RlUnVudGltZUNvbmZpZxIgCgtjb25jdXJyZW5jeRgBIAEoBVILY29uY3VycmVuY3kSJQ'
|
||||
'oOd29ya3NwYWNlX3Jvb3QYAiABKAlSDXdvcmtzcGFjZVJvb3Q=');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: iop/runtime.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
export 'runtime.pb.dart';
|
||||
|
||||
Loading…
Reference in a new issue