@cofy-x/axern-sdk 0.6.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +28 -76
  2. package/dist/client/index.d.ts +49 -11
  3. package/dist/client/index.js +207 -58
  4. package/dist/config/index.d.ts +0 -1
  5. package/dist/config/index.js +2 -4
  6. package/dist/generated/proto.js +0 -1
  7. package/dist/index.d.ts +4 -5
  8. package/dist/index.js +1 -2
  9. package/dist/node/archive.js +1 -1
  10. package/dist/node/attached_process.d.ts +1 -2
  11. package/dist/node/attached_process.js +14 -28
  12. package/dist/node/capabilities.js +1 -1
  13. package/dist/node/client.d.ts +4 -6
  14. package/dist/node/client.js +2 -9
  15. package/dist/node/computer_use.js +1 -1
  16. package/dist/node/context.d.ts +1 -1
  17. package/dist/node/context.js +1 -1
  18. package/dist/node/exec.d.ts +1 -3
  19. package/dist/node/exec.js +1 -44
  20. package/dist/node/files.js +1 -1
  21. package/dist/node/process.d.ts +11 -6
  22. package/dist/node/process.js +45 -6
  23. package/dist/proto/axern/control/admin/v1/access.proto +12 -5
  24. package/dist/proto/axern/control/admin/v1/audit.proto +14 -16
  25. package/dist/proto/axern/control/admin/v1/node.proto +23 -67
  26. package/dist/proto/axern/control/admin/v1/reliability.proto +11 -78
  27. package/dist/proto/axern/control/capability/v1/capability.proto +34 -94
  28. package/dist/proto/axern/control/common/v1/common.proto +41 -98
  29. package/dist/proto/axern/control/environment/v1/environment.proto +42 -26
  30. package/dist/proto/axern/control/identity/v1/identity.proto +1 -1
  31. package/dist/proto/axern/control/namespace/v1/namespace.proto +2 -3
  32. package/dist/proto/axern/control/quota/v1/quota.proto +22 -32
  33. package/dist/proto/axern/control/run/v1/run.proto +25 -22
  34. package/dist/proto/axern/control/secret/v1/secret.proto +1 -3
  35. package/dist/proto/axern/control/tunnel/v1/tunnel.proto +20 -29
  36. package/dist/proto/axern/node/sandbox/v1/node.proto +106 -375
  37. package/dist/sandbox/index.d.ts +5 -11
  38. package/dist/sandbox/index.js +24 -25
  39. package/dist/sandbox/lifecycle.d.ts +1 -1
  40. package/dist/sandbox/lifecycle.js +55 -17
  41. package/dist/tunnel/connector.js +1 -1
  42. package/dist/tunnel/control.d.ts +0 -1
  43. package/dist/tunnel/control.js +0 -1
  44. package/dist/tunnel/runtime.d.ts +0 -1
  45. package/dist/tunnel/runtime.js +0 -1
  46. package/dist/tunnel/types.d.ts +0 -1
  47. package/dist/types.d.ts +4 -24
  48. package/dist/types.js +1 -3
  49. package/dist/version.d.ts +1 -1
  50. package/dist/version.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/proto/axern/control/admin/v1/allocation_lifecycle.proto +0 -91
  53. package/dist/proto/axern/control/admin/v1/service.proto +0 -18
  54. package/dist/proto/axern/control/admin/v1/storage.proto +0 -81
  55. package/dist/proto/axern/control/agentprofile/v1/agent_profile.proto +0 -169
  56. package/dist/proto/axern/control/catalog/v1/catalog.proto +0 -127
  57. package/dist/proto/axern/control/function/v1/function.proto +0 -130
  58. package/dist/proto/axern/control/function/v1/function_types.proto +0 -233
  59. package/dist/proto/axern/control/gateway/v1/gateway.proto +0 -92
  60. package/dist/proto/axern/control/node/v1/node_control.proto +0 -443
  61. package/dist/proto/axern/control/rollout/v1/rollout.proto +0 -344
  62. package/dist/proto/axern/control/service/v1/service.proto +0 -96
  63. package/dist/proto/axern/control/service/v1/service_event.proto +0 -47
  64. package/dist/proto/axern/control/service/v1/service_replica.proto +0 -78
  65. package/dist/proto/axern/control/service/v1/service_types.proto +0 -155
  66. package/dist/proto/axern/control/storage/v1/storage.proto +0 -107
  67. package/dist/proto/axern/control/storage/v1/storage_types.proto +0 -125
  68. package/dist/proto/axern/data/artifact/v1/artifact.proto +0 -19
@@ -4,14 +4,45 @@ package axern.control.environment.v1;
4
4
 
5
5
  option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/environment/v1;environmentv1";
6
6
 
7
- import "axern/control/catalog/v1/catalog.proto";
8
7
  import "google/protobuf/timestamp.proto";
9
8
 
9
+ message EnvironmentMount {
10
+ string type = 1;
11
+ string source = 2;
12
+ string target = 3;
13
+ repeated string options = 4;
14
+ }
15
+
16
+ message OciImageDescriptor {
17
+ string digest = 1;
18
+ string media_type = 2;
19
+ int64 size_bytes = 3;
20
+ map<string, string> annotations = 4;
21
+ }
22
+
23
+ message OciBaselinePolicy {
24
+ repeated string capabilities = 1;
25
+ uint64 no_file_limit = 2;
26
+ }
27
+
28
+ message OciExecutionProfile {
29
+ OciBaselinePolicy baseline = 1;
30
+ }
31
+
32
+ message ResolvedEnvironmentSpec {
33
+ bool rootfs_readonly = 1;
34
+ repeated string image_default_argv = 2;
35
+ string default_cwd = 3;
36
+ map<string, string> default_env = 4;
37
+ repeated EnvironmentMount mounts = 5;
38
+ OciImageDescriptor image_descriptor = 6;
39
+ OciExecutionProfile execution_profile = 7;
40
+ }
41
+
10
42
  message EnvironmentImageSource {
11
43
  string ref = 1;
12
- string digest = 2;
13
- bool rootfs_readonly = 3;
14
- string registry_credential_id = 4;
44
+ bool rootfs_readonly = 2;
45
+ string registry_credential_id = 3;
15
46
  }
16
47
 
17
48
  message EnvironmentSpec {
@@ -21,35 +52,20 @@ message EnvironmentSpec {
21
52
  EnvironmentImageSource image = 4;
22
53
  }
23
54
 
24
- enum EnvironmentStatus {
25
- ENVIRONMENT_STATUS_UNSPECIFIED = 0;
26
- ENVIRONMENT_STATUS_PENDING = 1;
27
- ENVIRONMENT_STATUS_READY = 2;
28
- ENVIRONMENT_STATUS_FAILED = 3;
29
- ENVIRONMENT_STATUS_DELETING = 4;
30
- ENVIRONMENT_STATUS_DELETED = 5;
31
- }
32
-
33
55
  message Environment {
34
56
  string id = 1;
35
57
  string namespace = 2;
36
- EnvironmentStatus status = 3;
37
- EnvironmentSpec spec = 4;
38
- string spec_hash = 5;
39
- axern.control.catalog.v1.RuntimeTemplate resolved_template = 6;
40
- map<string, string> labels = 7;
41
- int64 version = 8;
42
- google.protobuf.Timestamp created_at = 9;
43
- google.protobuf.Timestamp updated_at = 10;
44
- string message = 11;
58
+ EnvironmentSpec spec = 3;
59
+ ResolvedEnvironmentSpec resolved_spec = 4;
60
+ map<string, string> labels = 5;
61
+ google.protobuf.Timestamp created_at = 6;
45
62
  }
46
63
 
47
64
  message ListFilter {
48
65
  string namespace = 1;
49
- repeated EnvironmentStatus statuses = 2;
50
- map<string, string> labels = 3;
51
- string cursor = 4;
52
- int32 page_size = 5;
66
+ map<string, string> labels = 2;
67
+ string cursor = 3;
68
+ int32 page_size = 4;
53
69
  }
54
70
 
55
71
  message CreateEnvironmentRequest {
@@ -17,7 +17,7 @@ message CredentialIdentity {
17
17
  string credential_id = 1;
18
18
  string label = 2;
19
19
  string fingerprint = 3;
20
- google.protobuf.Timestamp certificate_not_after = 4;
20
+ google.protobuf.Timestamp expires_at = 4;
21
21
  }
22
22
 
23
23
  message EffectiveRole {
@@ -8,9 +8,8 @@ import "google/protobuf/timestamp.proto";
8
8
 
9
9
  message Namespace {
10
10
  string namespace = 1;
11
- int64 version = 2;
12
- google.protobuf.Timestamp created_at = 3;
13
- google.protobuf.Timestamp updated_at = 4;
11
+ google.protobuf.Timestamp created_at = 2;
12
+ google.protobuf.Timestamp deleted_at = 3;
14
13
  }
15
14
 
16
15
  message CreateNamespaceRequest {
@@ -11,16 +11,15 @@ message NamespaceQuota {
11
11
  string namespace = 1;
12
12
  google.protobuf.Int64Value cpu_milli_limit = 2;
13
13
  google.protobuf.Int64Value memory_bytes_limit = 3;
14
- int64 reserved_cpu_milli = 4;
15
- int64 reserved_memory_bytes = 5;
14
+ int64 used_cpu_milli = 4;
15
+ int64 used_memory_bytes = 5;
16
16
  google.protobuf.Int64Value available_cpu_milli = 6;
17
17
  google.protobuf.Int64Value available_memory_bytes = 7;
18
- int64 version = 8;
19
- google.protobuf.Timestamp created_at = 9;
20
- google.protobuf.Timestamp updated_at = 10;
21
- google.protobuf.Int64Value ephemeral_storage_bytes_limit = 11;
22
- int64 reserved_ephemeral_storage_bytes = 12;
23
- google.protobuf.Int64Value available_ephemeral_storage_bytes = 13;
18
+ google.protobuf.Timestamp created_at = 8;
19
+ google.protobuf.Timestamp updated_at = 9;
20
+ google.protobuf.Int64Value ephemeral_storage_bytes_limit = 10;
21
+ int64 used_ephemeral_storage_bytes = 11;
22
+ google.protobuf.Int64Value available_ephemeral_storage_bytes = 12;
24
23
  }
25
24
 
26
25
  enum NamespaceQuotaEventType {
@@ -28,12 +27,6 @@ enum NamespaceQuotaEventType {
28
27
  NAMESPACE_QUOTA_EVENT_TYPE_ADMISSION_REJECTED = 1;
29
28
  }
30
29
 
31
- enum NamespaceQuotaEventWorkloadType {
32
- NAMESPACE_QUOTA_EVENT_WORKLOAD_TYPE_UNSPECIFIED = 0;
33
- NAMESPACE_QUOTA_EVENT_WORKLOAD_TYPE_RUN = 1;
34
- NAMESPACE_QUOTA_EVENT_WORKLOAD_TYPE_SERVICE = 2;
35
- }
36
-
37
30
  enum NamespaceQuotaEventReason {
38
31
  NAMESPACE_QUOTA_EVENT_REASON_UNSPECIFIED = 0;
39
32
  NAMESPACE_QUOTA_EVENT_REASON_INSUFFICIENT_CPU = 1;
@@ -46,24 +39,21 @@ message NamespaceQuotaEvent {
46
39
  string id = 1;
47
40
  string namespace = 2;
48
41
  NamespaceQuotaEventType type = 3;
49
- NamespaceQuotaEventWorkloadType workload_type = 4;
50
- string workload_id = 5;
51
- string environment_id = 6;
52
- NamespaceQuotaEventReason reason = 7;
53
- int64 requested_cpu_milli = 8;
54
- int64 reserved_cpu_milli = 9;
55
- google.protobuf.Int64Value cpu_milli_limit = 10;
56
- google.protobuf.Int64Value available_cpu_milli = 11;
57
- int64 requested_memory_bytes = 12;
58
- int64 reserved_memory_bytes = 13;
59
- google.protobuf.Int64Value memory_bytes_limit = 14;
60
- google.protobuf.Int64Value available_memory_bytes = 15;
61
- string message = 16;
62
- google.protobuf.Timestamp created_at = 17;
63
- int64 requested_ephemeral_storage_bytes = 18;
64
- int64 reserved_ephemeral_storage_bytes = 19;
65
- google.protobuf.Int64Value ephemeral_storage_bytes_limit = 20;
66
- google.protobuf.Int64Value available_ephemeral_storage_bytes = 21;
42
+ string environment_id = 4;
43
+ NamespaceQuotaEventReason reason = 5;
44
+ int64 requested_cpu_milli = 6;
45
+ int64 used_cpu_milli = 7;
46
+ google.protobuf.Int64Value cpu_milli_limit = 8;
47
+ google.protobuf.Int64Value available_cpu_milli = 9;
48
+ int64 requested_memory_bytes = 10;
49
+ int64 used_memory_bytes = 11;
50
+ google.protobuf.Int64Value memory_bytes_limit = 12;
51
+ google.protobuf.Int64Value available_memory_bytes = 13;
52
+ google.protobuf.Timestamp created_at = 14;
53
+ int64 requested_ephemeral_storage_bytes = 15;
54
+ int64 used_ephemeral_storage_bytes = 16;
55
+ google.protobuf.Int64Value ephemeral_storage_bytes_limit = 17;
56
+ google.protobuf.Int64Value available_ephemeral_storage_bytes = 18;
67
57
  }
68
58
 
69
59
  message GetNamespaceQuotaRequest {
@@ -6,17 +6,17 @@ option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/run/v1;run
6
6
 
7
7
  import "axern/control/common/v1/common.proto";
8
8
  import "axern/control/capability/v1/capability.proto";
9
+ import "axern/control/environment/v1/environment.proto";
9
10
  import "google/protobuf/timestamp.proto";
10
11
 
11
12
  enum RunStatus {
12
13
  RUN_STATUS_UNSPECIFIED = 0;
13
- RUN_STATUS_QUEUED = 1;
14
- RUN_STATUS_PLACED = 2;
15
- RUN_STATUS_STARTING = 3;
16
- RUN_STATUS_RUNNING = 4;
17
- RUN_STATUS_SUCCEEDED = 5;
18
- RUN_STATUS_FAILED = 6;
19
- RUN_STATUS_CANCELLED = 7;
14
+ RUN_STATUS_PLACED = 1;
15
+ RUN_STATUS_STARTING = 2;
16
+ RUN_STATUS_RUNNING = 3;
17
+ RUN_STATUS_SUCCEEDED = 4;
18
+ RUN_STATUS_FAILED = 5;
19
+ RUN_STATUS_CANCELLED = 6;
20
20
  }
21
21
 
22
22
  message Run {
@@ -24,21 +24,24 @@ message Run {
24
24
  string namespace = 2;
25
25
  string environment_id = 3;
26
26
  string allocation_id = 4;
27
- int64 attempt = 5;
28
- RunStatus status = 6;
29
- axern.control.common.v1.ExecutionConfig config = 7;
30
- map<string, string> labels = 8;
31
- int64 version = 9;
32
- google.protobuf.Timestamp created_at = 10;
33
- google.protobuf.Timestamp updated_at = 11;
34
- int32 exit_code = 12;
35
- bool exit_code_known = 13;
36
- string message = 14;
37
- axern.control.common.v1.WorkloadDiagnosticCode diagnostic_code = 15;
38
- // Full, monotonically revised allocation capability condition projection.
39
- // It is independent from run lifecycle status and message.
40
- axern.control.capability.v1.CapabilityConditionSet capability_conditions = 16;
41
- reserved 17 to 18;
27
+ RunStatus status = 5;
28
+ axern.control.common.v1.ExecutionConfig config = 6;
29
+ map<string, string> labels = 7;
30
+ int64 version = 8;
31
+ google.protobuf.Timestamp created_at = 9;
32
+ google.protobuf.Timestamp updated_at = 10;
33
+ optional int32 exit_code = 11;
34
+ string message = 12;
35
+ axern.control.common.v1.WorkloadDiagnosticCode diagnostic_code = 13;
36
+ // Latest allocation capability condition projection. It is independent
37
+ // from Run lifecycle status and message.
38
+ axern.control.capability.v1.CapabilityConditionSet capability_conditions = 14;
39
+ // Immutable Environment input frozen atomically with Run admission. The
40
+ // source record may be deleted after this Run is created.
41
+ axern.control.environment.v1.EnvironmentSpec environment_spec = 15;
42
+ axern.control.environment.v1.ResolvedEnvironmentSpec resolved_environment_spec = 16;
43
+ // Node-local stdout/stderr availability deadline; node loss may make bytes unavailable earlier.
44
+ google.protobuf.Timestamp output_expires_at = 17;
42
45
  }
43
46
 
44
47
  message RunListFilter {
@@ -18,9 +18,7 @@ message Secret {
18
18
  SecretType type = 3;
19
19
  repeated string data_keys = 4;
20
20
  map<string, string> labels = 5;
21
- int64 version = 6;
22
- google.protobuf.Timestamp created_at = 7;
23
- google.protobuf.Timestamp updated_at = 8;
21
+ google.protobuf.Timestamp created_at = 6;
24
22
  }
25
23
 
26
24
  message SecretListFilter {
@@ -66,28 +66,21 @@ enum TunnelSessionEventReasonCode {
66
66
  message TunnelSession {
67
67
  string session_id = 1;
68
68
  string allocation_id = 2;
69
- string node_id = 3;
70
- string node_target = 4;
71
- int64 attempt = 5;
72
- int32 remote_port = 6;
73
- string local_target = 7;
74
- string edge_target = 8;
75
- TunnelSessionStatus status = 9;
76
- string reason = 10;
77
- string bound_addr = 11;
78
- bool revoked = 12;
79
- google.protobuf.Timestamp created_at = 13;
80
- google.protobuf.Timestamp updated_at = 14;
81
- google.protobuf.Timestamp expires_at = 15;
82
- string node_edge_target = 16;
83
- string relay_id = 17;
84
- string client_edge_target = 18;
85
- google.protobuf.Timestamp ready_at = 19;
86
- google.protobuf.Timestamp last_peer_event_at = 20;
87
- int64 bytes_in = 21;
88
- int64 bytes_out = 22;
89
- string namespace = 23;
90
- string creator_principal_id = 24;
69
+ int32 remote_port = 3;
70
+ string client_edge_target = 4;
71
+ TunnelSessionStatus status = 5;
72
+ string reason = 6;
73
+ string bound_addr = 7;
74
+ google.protobuf.Timestamp created_at = 8;
75
+ google.protobuf.Timestamp updated_at = 9;
76
+ google.protobuf.Timestamp expires_at = 10;
77
+ string relay_id = 11;
78
+ google.protobuf.Timestamp ready_at = 12;
79
+ google.protobuf.Timestamp last_peer_event_at = 13;
80
+ int64 bytes_in = 14;
81
+ int64 bytes_out = 15;
82
+ string namespace = 16;
83
+ string creator_principal_id = 17;
91
84
  }
92
85
 
93
86
  message TunnelSessionEvent {
@@ -108,10 +101,9 @@ message TunnelSessionEvent {
108
101
  message CreateTunnelSessionRequest {
109
102
  string allocation_id = 1;
110
103
  optional int32 remote_port = 2;
111
- string local_target = 3;
112
- google.protobuf.Duration ttl = 4;
113
- bool wait_ready = 5;
114
- google.protobuf.Duration ready_timeout = 6;
104
+ google.protobuf.Duration ttl = 3;
105
+ bool wait_ready = 4;
106
+ google.protobuf.Duration ready_timeout = 5;
115
107
  }
116
108
 
117
109
  message CreateTunnelSessionResponse {
@@ -129,9 +121,8 @@ message GetTunnelSessionResponse {
129
121
 
130
122
  message ListTunnelSessionsRequest {
131
123
  string allocation_id = 1;
132
- string node_id = 2;
133
- bool include_terminal = 3;
134
- string namespace = 4;
124
+ bool include_terminal = 2;
125
+ string namespace = 3;
135
126
  }
136
127
 
137
128
  message ListTunnelSessionsResponse {