-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.proto
More file actions
101 lines (84 loc) · 2.74 KB
/
Copy pathtask.proto
File metadata and controls
101 lines (84 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
syntax = "proto3";
option go_package = "proto_gen/";
import "registry.proto";
package task;
message FunctionIdentifier {
registry.ArtifactIdentifier artifact = 1;
string interface = 2;
string name = 3;
}
// A WIT value — represents any value in the WebAssembly Component Model type
// system. See https://component-model.bytecodealliance.org/design/wit.html
message Val {
oneof value {
// Primitive types
bool bool_val = 1;
sint32 s8_val = 2; // s8
uint32 u8_val = 3; // u8
sint32 s16_val = 4; // s16
uint32 u16_val = 5; // u16
sint32 s32_val = 6; // s32
uint32 u32_val = 7; // u32
sint64 s64_val = 8; // s64
uint64 u64_val = 9; // u64
float f32_val = 10; // f32
double f64_val = 11; // f64
uint32 char_val = 12; // char — Unicode scalar value (0..=0x10FFFF)
string string_val = 13; // string
// Compound built-in types
ListVal list_val = 14; // list<T>
TupleVal tuple_val = 15; // tuple<T0, T1, ...>
OptionVal option_val = 16; // option<T>
ResultVal result_val = 17; // result<T, E>
// User-defined types
RecordVal record_val = 18; // record { name: T, ... }
VariantVal variant_val = 19; // variant { case(T?), ... }
string enum_val = 20; // enum { case, ... } — carries the case name
FlagsVal flags_val = 21; // flags { name, ... } — set of active flag names
}
}
// list<T> — ordered sequence of values
message ListVal {
repeated Val values = 1;
}
// tuple<T0, T1, ...> — fixed-length ordered sequence
message TupleVal {
repeated Val values = 1;
}
// option<T> — absent value field means none; present means some(value)
message OptionVal {
Val value = 1;
}
// result<T, E> — is_ok=true → ok case, is_ok=false → err case;
// value is absent when the case carries no payload (unit)
message ResultVal {
bool is_ok = 1;
Val value = 2;
}
// record { field-name: T, ... } — named fields in declaration order
message RecordVal {
repeated RecordField fields = 1;
}
message RecordField {
string name = 1;
Val value = 2;
}
// variant { case-name(T?), ... } — active case name plus optional payload
message VariantVal {
string name = 1;
Val value = 2; // absent if the case carries no payload
}
// flags { flag-name, ... } — names of all active (set) flags
message FlagsVal {
repeated string flags = 1;
}
message EnvironmentVariable {
string key = 1;
string value = 2;
}
message Task {
FunctionIdentifier function = 1;
repeated Val parameters = 2;
repeated string arguments = 3;
repeated EnvironmentVariable environment_variables = 4;
}