@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,11 +4,11 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { AxernClient } from "../client/index.js";
7
- import type { ExtensionCapability } from "../client/index.js";
7
+ import type { DeclaredOutput, ExtensionCapability } from "../client/index.js";
8
8
  import type { SandboxProcess } from "../node/process.js";
9
9
  import type { ResourceQuantity } from "../resources.js";
10
10
  import type { NetworkPolicy } from "../network-policy.js";
11
- import type { ChmodOptions, CapabilityStatus, Command, ComputerUseDisplay, ComputerUseKeyboardOptions, ComputerUseMouseOptions, ComputerUseScreenshot, ComputerUseScreenshotOptions, ComputerUseStatus, CopyOptions, DownloadDirOptions, ExecOptions, ExecResult, ImageExecOptions, ImageProcessOptions, MkdirOptions, MoveOptions, NodeCallOptions, ProcessOptions, RemoveOptions, SandboxFileInfo, TunnelMetadata, TunnelOptions, TouchOptions, UploadDirOptions, VolumeMount, WriteFileOptions } from "../types.js";
11
+ import type { ChmodOptions, CapabilityStatus, Command, ComputerUseDisplay, ComputerUseKeyboardOptions, ComputerUseMouseOptions, ComputerUseScreenshot, ComputerUseScreenshotOptions, ComputerUseStatus, CopyOptions, DownloadDirOptions, ExecOptions, ExecResult, MkdirOptions, MoveOptions, NodeCallOptions, ProcessOptions, RemoveOptions, SandboxFileInfo, TunnelMetadata, TunnelOptions, TouchOptions, UploadDirOptions, WriteFileOptions } from "../types.js";
12
12
  export interface SandboxOptions {
13
13
  client: AxernClient;
14
14
  templateId?: string;
@@ -18,10 +18,9 @@ export interface SandboxOptions {
18
18
  argv?: string[];
19
19
  env?: Record<string, string>;
20
20
  cwd?: string;
21
- runtimeClass?: string;
22
21
  networkPolicy?: NetworkPolicy;
23
22
  extensionCapabilities?: readonly ExtensionCapability[];
24
- volumes?: readonly VolumeMount[];
23
+ declaredOutputs?: readonly DeclaredOutput[];
25
24
  requestCpu?: ResourceQuantity;
26
25
  requestMemory?: ResourceQuantity;
27
26
  requestEphemeralStorage?: ResourceQuantity;
@@ -36,15 +35,12 @@ export interface SandboxOptions {
36
35
  }
37
36
  export interface SandboxState {
38
37
  environmentId: string;
39
- serviceId: string;
38
+ runId: string;
40
39
  allocationId: string;
41
- nodeId: string;
42
- attempt: number;
43
40
  startedAt: Date;
44
41
  }
45
42
  export interface SandboxMetadata extends SandboxState {
46
43
  namespace: string;
47
- runtimeClass: string;
48
44
  labels: Record<string, string>;
49
45
  source: "template" | "image" | "environment";
50
46
  tunnel?: TunnelMetadata;
@@ -54,7 +50,7 @@ export declare class Sandbox {
54
50
  private readonly options;
55
51
  private createdEnvironment;
56
52
  private environmentId;
57
- private serviceId;
53
+ private runId;
58
54
  private currentState?;
59
55
  private currentMetadata?;
60
56
  private tunnelRuntime?;
@@ -65,8 +61,6 @@ export declare class Sandbox {
65
61
  close(): Promise<void>;
66
62
  exec(command: Command, options?: ExecOptions): Promise<ExecResult>;
67
63
  process(command: Command, options?: ProcessOptions): Promise<SandboxProcess>;
68
- execImage(image: string, command: Command, options?: ImageExecOptions): Promise<ExecResult>;
69
- processImage(image: string, command: Command, options?: ImageProcessOptions): Promise<SandboxProcess>;
70
64
  capabilityStatus(options?: NodeCallOptions): Promise<CapabilityStatus>;
71
65
  computerUseStatus(options?: NodeCallOptions): Promise<ComputerUseStatus>;
72
66
  computerUseScreenshot(options?: ComputerUseScreenshotOptions): Promise<ComputerUseScreenshot>;
@@ -6,13 +6,13 @@
6
6
  import { SandboxStateError } from "../errors/index.js";
7
7
  import { startTunnelRuntime, tunnelMetadata } from "../tunnel/runtime.js";
8
8
  import { directoryArchiveChunks, extractDirectoryArchive } from "./archive.js";
9
- import { defaultSandboxArgv, sandboxLabels, sandboxMetadata, validateSandboxOptions, waitReadyReplica } from "./lifecycle.js";
9
+ import { defaultSandboxArgv, sandboxLabels, sandboxMetadata, validateSandboxOptions, waitRunningRun } from "./lifecycle.js";
10
10
  export class Sandbox {
11
11
  client;
12
12
  options;
13
13
  createdEnvironment = false;
14
14
  environmentId = "";
15
- serviceId = "";
15
+ runId = "";
16
16
  currentState;
17
17
  currentMetadata;
18
18
  tunnelRuntime;
@@ -52,16 +52,15 @@ export class Sandbox {
52
52
  this.environmentId = environmentId;
53
53
  this.createdEnvironment = true;
54
54
  }
55
- const service = await this.client.createService({
55
+ const run = await this.client.createRun({
56
56
  namespace: this.options.namespace,
57
57
  environmentId,
58
58
  argv: this.options.argv ?? defaultSandboxArgv,
59
59
  env: this.options.env,
60
60
  cwd: this.options.cwd,
61
- runtimeClass: this.options.runtimeClass,
62
61
  networkPolicy: this.options.networkPolicy,
63
62
  extensionCapabilities: this.options.extensionCapabilities,
64
- volumes: this.options.volumes,
63
+ declaredOutputs: this.options.declaredOutputs,
65
64
  requestCpu: this.options.requestCpu,
66
65
  requestMemory: this.options.requestMemory,
67
66
  requestEphemeralStorage: this.options.requestEphemeralStorage,
@@ -70,14 +69,12 @@ export class Sandbox {
70
69
  limitEphemeralStorage: this.options.limitEphemeralStorage,
71
70
  labels: sandboxLabels(this.options.labels),
72
71
  });
73
- this.serviceId = String(service.id ?? "");
74
- const replica = await waitReadyReplica(this.serviceId, this.options.readyTimeoutMs ?? 180_000, (serviceId) => this.client.listServiceReplicas(serviceId));
72
+ this.runId = String(run.id ?? "");
73
+ const runningRun = await waitRunningRun(this.runId, this.options.readyTimeoutMs ?? 180_000, (runId, signal) => this.client.watchRun(runId, { signal }));
75
74
  this.currentState = {
76
75
  environmentId,
77
- serviceId: this.serviceId,
78
- allocationId: String(replica.id ?? ""),
79
- nodeId: String(replica.node_id ?? ""),
80
- attempt: Number(replica.attempt ?? 0),
76
+ runId: this.runId,
77
+ allocationId: String(runningRun.allocation_id ?? ""),
81
78
  startedAt: new Date(),
82
79
  };
83
80
  this.currentMetadata = sandboxMetadata(this.options, this.currentState);
@@ -96,29 +93,37 @@ export class Sandbox {
96
93
  return this;
97
94
  }
98
95
  catch (error) {
99
- await this.close();
96
+ try {
97
+ await this.close();
98
+ }
99
+ catch (cleanupError) {
100
+ throw new AggregateError([error, cleanupError], "sandbox start and cleanup failed");
101
+ }
100
102
  throw error;
101
103
  }
102
104
  }
103
105
  async close() {
104
- const serviceId = this.serviceId;
106
+ const errors = [];
107
+ const runId = this.runId;
105
108
  const tunnelRuntime = this.tunnelRuntime;
106
- this.serviceId = "";
109
+ this.runId = "";
107
110
  this.tunnelRuntime = undefined;
108
111
  this.currentState = undefined;
109
112
  this.currentMetadata = undefined;
110
113
  if (tunnelRuntime !== undefined) {
111
- await tunnelRuntime.stop().catch(() => undefined);
114
+ await tunnelRuntime.stop().catch((error) => errors.push(error));
112
115
  }
113
- if (serviceId !== "") {
114
- await this.client.deleteService(serviceId).catch(() => undefined);
116
+ if (runId !== "") {
117
+ await this.client.cancelRun(runId).catch((error) => errors.push(error));
115
118
  }
116
119
  if (this.createdEnvironment && this.environmentId !== "") {
117
120
  const environmentId = this.environmentId;
118
121
  this.environmentId = "";
119
122
  this.createdEnvironment = false;
120
- await this.client.deleteEnvironment(environmentId).catch(() => undefined);
123
+ await this.client.deleteEnvironment(environmentId).catch((error) => errors.push(error));
121
124
  }
125
+ if (errors.length > 0)
126
+ throw new AggregateError(errors, "sandbox cleanup failed");
122
127
  }
123
128
  async exec(command, options = {}) {
124
129
  return this.nodeClient().exec(command, options);
@@ -126,12 +131,6 @@ export class Sandbox {
126
131
  async process(command, options = {}) {
127
132
  return this.nodeClient().process(command, options);
128
133
  }
129
- async execImage(image, command, options = {}) {
130
- return this.nodeClient().execImage(image, command, options);
131
- }
132
- async processImage(image, command, options = {}) {
133
- return this.nodeClient().processImage(image, command, options);
134
- }
135
134
  async capabilityStatus(options = {}) {
136
135
  return this.nodeClient().capabilityStatus(options);
137
136
  }
@@ -203,6 +202,6 @@ export class Sandbox {
203
202
  if (this.currentState === undefined) {
204
203
  throw new SandboxStateError("sandbox is not started");
205
204
  }
206
- return this.client.nodeSandbox(this.currentState.allocationId);
205
+ return this.client.allocation(this.currentState.allocationId);
207
206
  }
208
207
  }
@@ -8,4 +8,4 @@ export declare const defaultSandboxArgv: string[];
8
8
  export declare function validateSandboxOptions(options: SandboxOptions): void;
9
9
  export declare function sandboxLabels(labels: Record<string, string> | undefined): Record<string, string>;
10
10
  export declare function sandboxMetadata(options: SandboxOptions, state: SandboxState): SandboxMetadata;
11
- export declare function waitReadyReplica(serviceId: string, timeoutMs: number, listReplicas: (serviceId: string) => Promise<Record<string, unknown>[]>): Promise<Record<string, unknown>>;
11
+ export declare function waitRunningRun(runId: string, timeoutMs: number, watchRun: (runId: string, signal: AbortSignal) => AsyncIterable<Record<string, unknown>>): Promise<Record<string, unknown>>;
@@ -5,6 +5,12 @@
5
5
  */
6
6
  import { SandboxTimeoutError, SandboxValidationError } from "../errors/index.js";
7
7
  export const defaultSandboxArgv = ["/bin/sh", "-lc", "sleep infinity"];
8
+ const runStatus = {
9
+ running: 3,
10
+ succeeded: 4,
11
+ failed: 5,
12
+ cancelled: 6,
13
+ };
8
14
  export function validateSandboxOptions(options) {
9
15
  const sourceCount = [options.templateId, options.image, options.environmentId].filter((source) => source !== undefined && source !== "").length;
10
16
  if (sourceCount !== 1) {
@@ -21,27 +27,62 @@ export function sandboxMetadata(options, state) {
21
27
  return {
22
28
  ...state,
23
29
  namespace: options.namespace ?? "default",
24
- runtimeClass: options.runtimeClass ?? "",
25
30
  labels: sandboxLabels(options.labels),
26
31
  source: sandboxSource(options),
27
32
  };
28
33
  }
29
- export async function waitReadyReplica(serviceId, timeoutMs, listReplicas) {
34
+ export async function waitRunningRun(runId, timeoutMs, watchRun) {
30
35
  const deadline = Date.now() + timeoutMs;
31
- let lastReplicas = [];
32
- while (Date.now() < deadline) {
33
- lastReplicas = await listReplicas(serviceId);
34
- const candidate = lastReplicas.find((replica) => replica.ready === true &&
35
- replica.ended !== true &&
36
- replica.outdated !== true &&
37
- Number(replica.status ?? 0) === 4);
38
- if (candidate !== undefined) {
39
- return candidate;
36
+ let lastRun;
37
+ const controller = new AbortController();
38
+ const iterator = watchRun(runId, controller.signal)[Symbol.asyncIterator]();
39
+ try {
40
+ for (;;) {
41
+ const remainingMs = deadline - Date.now();
42
+ if (remainingMs <= 0)
43
+ break;
44
+ const result = await nextBeforeDeadline(iterator, remainingMs);
45
+ if (result === undefined || result.done)
46
+ break;
47
+ const run = result.value;
48
+ lastRun = run;
49
+ const status = Number(run.status ?? 0);
50
+ if (status === runStatus.running && String(run.allocation_id ?? "") !== "") {
51
+ return run;
52
+ }
53
+ if (status === runStatus.succeeded || status === runStatus.failed || status === runStatus.cancelled) {
54
+ throw new Error(`run ${runId} became ${String(run.status ?? "")} before its sandbox allocation was running: ${String(run.message ?? "")}`);
55
+ }
40
56
  }
41
- await sleep(2_000);
42
57
  }
43
- const details = lastReplicas.map((replica) => `${String(replica.id ?? "")}:${String(replica.status ?? "")}`).join(", ");
44
- throw new SandboxTimeoutError(`service ${serviceId} did not produce a ready sandbox replica: ${details}`);
58
+ finally {
59
+ controller.abort();
60
+ try {
61
+ const close = iterator.return?.();
62
+ if (close !== undefined)
63
+ void close.catch(() => undefined);
64
+ }
65
+ catch {
66
+ // The readiness result owns the error surface; stream cleanup is best effort.
67
+ }
68
+ }
69
+ const details = lastRun === undefined ? "no state observed" : `${String(lastRun.status ?? "")}: ${String(lastRun.message ?? "")}`;
70
+ throw new SandboxTimeoutError(`run ${runId} did not reach a running sandbox allocation: ${details}`);
71
+ }
72
+ async function nextBeforeDeadline(iterator, timeoutMs) {
73
+ let timer;
74
+ try {
75
+ return await Promise.race([
76
+ iterator.next(),
77
+ new Promise((resolve) => {
78
+ timer = setTimeout(resolve, timeoutMs);
79
+ }),
80
+ ]);
81
+ }
82
+ finally {
83
+ if (timer !== undefined)
84
+ clearTimeout(timer);
85
+ }
45
86
  }
46
87
  function sandboxSource(options) {
47
88
  if (options.templateId !== undefined && options.templateId !== "") {
@@ -52,6 +93,3 @@ function sandboxSource(options) {
52
93
  }
53
94
  return "environment";
54
95
  }
55
- function sleep(ms) {
56
- return new Promise((resolve) => setTimeout(resolve, ms));
57
- }
@@ -26,7 +26,7 @@ export class TunnelConnector {
26
26
  this.config = config;
27
27
  }
28
28
  async start() {
29
- const target = this.config.session.client_edge_target || this.config.session.edge_target;
29
+ const target = this.config.session.client_edge_target;
30
30
  if (target === undefined || target === "") {
31
31
  throw new Error(`tunnel session ${this.config.session.session_id ?? ""} has no relay target`);
32
32
  }
@@ -10,7 +10,6 @@ export declare class TunnelControlClient {
10
10
  constructor(client: grpc.Client);
11
11
  createSession(options: {
12
12
  allocationId: string;
13
- upstream: string;
14
13
  proxyPort: number;
15
14
  ttlSeconds: number;
16
15
  readyTimeoutMs: number;
@@ -16,7 +16,6 @@ export class TunnelControlClient {
16
16
  const response = await unary(this.client, "CreateTunnelSession", {
17
17
  allocation_id: required("allocationId", options.allocationId),
18
18
  remote_port: options.proxyPort,
19
- local_target: required("upstream", options.upstream),
20
19
  ttl: duration(options.ttlSeconds * 1000),
21
20
  wait_ready: true,
22
21
  ready_timeout: duration(options.readyTimeoutMs),
@@ -14,7 +14,6 @@ export interface TunnelConnectorRunner {
14
14
  export interface TunnelControl {
15
15
  createSession(options: {
16
16
  allocationId: string;
17
- upstream: string;
18
17
  proxyPort: number;
19
18
  ttlSeconds: number;
20
19
  readyTimeoutMs: number;
@@ -15,7 +15,6 @@ export async function startTunnelRuntime(options) {
15
15
  const proxyPort = options.tunnel.proxyPort ?? defaultProxyPort;
16
16
  const result = await options.control.createSession({
17
17
  allocationId: options.allocationId,
18
- upstream: options.tunnel.upstream,
19
18
  proxyPort,
20
19
  ttlSeconds,
21
20
  readyTimeoutMs: options.tunnel.readyTimeoutMs ?? defaultReadyTimeoutMs,
@@ -6,7 +6,6 @@
6
6
  export interface TunnelSession {
7
7
  session_id?: string;
8
8
  allocation_id?: string;
9
- edge_target?: string;
10
9
  client_edge_target?: string;
11
10
  bound_addr?: string;
12
11
  remote_port?: number;
package/dist/types.d.ts CHANGED
@@ -12,7 +12,6 @@ export interface ExecOptions {
12
12
  user?: string;
13
13
  tty?: boolean;
14
14
  check?: boolean;
15
- leaseTtlSeconds?: number;
16
15
  rpcTimeoutMs?: number;
17
16
  }
18
17
  export interface ExecResult {
@@ -24,22 +23,6 @@ export interface ExecResult {
24
23
  stdoutText(encoding?: BufferEncoding): string;
25
24
  stderrText(encoding?: BufferEncoding): string;
26
25
  }
27
- export interface ImageProcessMount {
28
- sandboxPath: string;
29
- targetPath: string;
30
- readonly?: boolean;
31
- options?: readonly string[];
32
- }
33
- export interface VolumeMount {
34
- name: string;
35
- target: string;
36
- readonly?: boolean;
37
- options?: readonly string[];
38
- }
39
- export declare function workspaceMount(path?: string): ImageProcessMount;
40
- export interface ImageExecOptions extends ExecOptions {
41
- mounts?: readonly ImageProcessMount[];
42
- }
43
26
  export type ProcessEvent = {
44
27
  kind: "ready";
45
28
  } | {
@@ -54,9 +37,8 @@ export type ProcessEvent = {
54
37
  message: string;
55
38
  };
56
39
  export interface ProcessOptions extends Omit<ExecOptions, "check"> {
57
- }
58
- export interface ImageProcessOptions extends ProcessOptions {
59
- mounts?: readonly ImageProcessMount[];
40
+ initialCols?: number;
41
+ initialRows?: number;
60
42
  }
61
43
  export interface ProcessResult {
62
44
  exitCode: number;
@@ -108,11 +90,9 @@ export interface DownloadDirOptions {
108
90
  export interface UploadArchiveOptions {
109
91
  createParents?: boolean;
110
92
  overwrite?: boolean;
111
- leaseTtlSeconds?: number;
112
93
  rpcTimeoutMs?: number;
113
94
  }
114
95
  export interface DownloadArchiveOptions {
115
- leaseTtlSeconds?: number;
116
96
  rpcTimeoutMs?: number;
117
97
  }
118
98
  export interface TunnelOptions {
@@ -134,7 +114,7 @@ export interface TunnelMetadata {
134
114
  upstream: string;
135
115
  proxyPort: number;
136
116
  }
137
- export interface CapabilityDependencyStatus {
117
+ export interface CapabilityProviderDependencyStatus {
138
118
  name: string;
139
119
  available: boolean;
140
120
  reason: string;
@@ -146,7 +126,7 @@ export interface CapabilityProviderStatus {
146
126
  capabilities: string[];
147
127
  backend: string;
148
128
  reason: string;
149
- dependencies: CapabilityDependencyStatus[];
129
+ dependencies: CapabilityProviderDependencyStatus[];
150
130
  }
151
131
  export interface CapabilityProviderSummary {
152
132
  total: number;
package/dist/types.js CHANGED
@@ -3,6 +3,4 @@
3
3
  * Copyright 2026 cofy-x
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export function workspaceMount(path = "/workspace") {
7
- return { sandboxPath: path, targetPath: path };
8
- }
6
+ export {};
package/dist/version.d.ts CHANGED
@@ -3,5 +3,5 @@
3
3
  * Copyright 2026 cofy-x
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export declare const AXERN_VERSION = "0.6.2";
6
+ export declare const AXERN_VERSION = "0.8.0";
7
7
  export declare function platformName(): string;
package/dist/version.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Copyright 2026 cofy-x
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export const AXERN_VERSION = "0.6.2";
6
+ export const AXERN_VERSION = "0.8.0";
7
7
  export function platformName() {
8
8
  return "axern";
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofy-x/axern-sdk",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "description": "TypeScript SDK for Axern agentic infrastructure and isolated sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,91 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package axern.control.admin.v1;
4
-
5
- option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/admin/v1;adminv1";
6
-
7
- import "google/protobuf/timestamp.proto";
8
-
9
- enum AllocationLifecycleRetryOwnerType {
10
- ALLOCATION_LIFECYCLE_RETRY_OWNER_TYPE_UNSPECIFIED = 0;
11
- ALLOCATION_LIFECYCLE_RETRY_OWNER_TYPE_RUN = 1;
12
- ALLOCATION_LIFECYCLE_RETRY_OWNER_TYPE_SERVICE = 2;
13
- }
14
-
15
- enum AllocationLifecycleRetryReason {
16
- ALLOCATION_LIFECYCLE_RETRY_REASON_UNSPECIFIED = 0;
17
- ALLOCATION_LIFECYCLE_RETRY_REASON_CREATE = 1;
18
- ALLOCATION_LIFECYCLE_RETRY_REASON_DELETE = 2;
19
- }
20
-
21
- message AllocationLifecycleRetry {
22
- string allocation_id = 1;
23
- string owner_id = 2;
24
- AllocationLifecycleRetryOwnerType owner_type = 3;
25
- string environment_id = 4;
26
- AllocationLifecycleRetryReason reason = 5;
27
- string node_id = 6;
28
- string node_target = 7;
29
- int64 attempt = 8;
30
- int32 reconcile_attempts = 9;
31
- string last_error = 10;
32
- google.protobuf.Timestamp next_run_at = 11;
33
- google.protobuf.Timestamp created_at = 12;
34
- google.protobuf.Timestamp updated_at = 13;
35
- int64 age_seconds = 14;
36
- bool due = 15;
37
- bool clearable = 16;
38
- string clear_blocked_reason = 17;
39
- }
40
-
41
- message AllocationLifecycleRetryFilter {
42
- AllocationLifecycleRetryOwnerType owner_type = 1;
43
- AllocationLifecycleRetryReason reason = 2;
44
- bool due_only = 3;
45
- }
46
-
47
- message ListAllocationLifecycleRetriesRequest {
48
- AllocationLifecycleRetryFilter filter = 1;
49
- int32 limit = 2;
50
- }
51
-
52
- message ListAllocationLifecycleRetriesResponse {
53
- repeated AllocationLifecycleRetry retries = 1;
54
- }
55
-
56
- message ForceAllocationLifecycleRetryRequest {
57
- string allocation_id = 1;
58
- AllocationLifecycleRetryReason reason = 2;
59
- string operator_reason = 3;
60
- }
61
-
62
- message ForceAllocationLifecycleRetryResponse {
63
- AllocationLifecycleRetry retry = 1;
64
- }
65
-
66
- message FailAllocationLifecycleRetryRequest {
67
- string allocation_id = 1;
68
- AllocationLifecycleRetryReason reason = 2;
69
- string operator_reason = 3;
70
- }
71
-
72
- message FailAllocationLifecycleRetryResponse {
73
- AllocationLifecycleRetry failed_retry = 1;
74
- }
75
-
76
- message ClearAllocationLifecycleRetryRequest {
77
- string allocation_id = 1;
78
- AllocationLifecycleRetryReason reason = 2;
79
- string operator_reason = 3;
80
- }
81
-
82
- message ClearAllocationLifecycleRetryResponse {
83
- AllocationLifecycleRetry cleared_retry = 1;
84
- }
85
-
86
- service AllocationLifecycleAdmin {
87
- rpc ListAllocationLifecycleRetries(ListAllocationLifecycleRetriesRequest) returns (ListAllocationLifecycleRetriesResponse) {}
88
- rpc ForceAllocationLifecycleRetry(ForceAllocationLifecycleRetryRequest) returns (ForceAllocationLifecycleRetryResponse) {}
89
- rpc FailAllocationLifecycleRetry(FailAllocationLifecycleRetryRequest) returns (FailAllocationLifecycleRetryResponse) {}
90
- rpc ClearAllocationLifecycleRetry(ClearAllocationLifecycleRetryRequest) returns (ClearAllocationLifecycleRetryResponse) {}
91
- }
@@ -1,18 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package axern.control.admin.v1;
4
-
5
- option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/admin/v1;adminv1";
6
-
7
- message PurgeServiceRequest {
8
- string service_id = 1;
9
- string operator_reason = 2;
10
- }
11
-
12
- message PurgeServiceResponse {
13
- string service_id = 1;
14
- }
15
-
16
- service ServiceAdmin {
17
- rpc PurgeService(PurgeServiceRequest) returns (PurgeServiceResponse) {}
18
- }
@@ -1,81 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package axern.control.admin.v1;
4
-
5
- option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/admin/v1;adminv1";
6
-
7
- import "axern/control/storage/v1/storage_types.proto";
8
- import "google/protobuf/timestamp.proto";
9
-
10
- message StorageBinding {
11
- string binding_id = 1;
12
- string claim_id = 2;
13
- string namespace = 3;
14
- string claim_name = 4;
15
- string workload_id = 5;
16
- string workload_type = 6;
17
- string allocation_id = 7;
18
- string node_id = 8;
19
- axern.control.storage.v1.VolumeStatus status = 9;
20
- string message = 10;
21
- google.protobuf.Timestamp created_at = 11;
22
- google.protobuf.Timestamp updated_at = 12;
23
- google.protobuf.Timestamp published_at = 13;
24
- google.protobuf.Timestamp released_at = 14;
25
- }
26
-
27
- message StorageBindingFilter {
28
- repeated axern.control.storage.v1.VolumeStatus statuses = 1;
29
- string namespace = 2;
30
- string claim_name = 3;
31
- string workload_id = 4;
32
- string allocation_id = 5;
33
- string node_id = 6;
34
- }
35
-
36
- message ListStorageBindingsRequest {
37
- StorageBindingFilter filter = 1;
38
- int32 limit = 2;
39
- }
40
-
41
- message ListStorageBindingsResponse {
42
- repeated StorageBinding bindings = 1;
43
- }
44
-
45
- message RetryStorageBindingRequest {
46
- string binding_id = 1;
47
- string operator_reason = 2;
48
- }
49
-
50
- message RetryStorageBindingResponse {
51
- StorageBinding binding = 1;
52
- }
53
-
54
- message StorageReclaim {
55
- string claim_id = 1;
56
- string namespace = 2;
57
- string claim_name = 3;
58
- string service_id = 4;
59
- string node_id = 5;
60
- int64 attempt = 6;
61
- google.protobuf.Timestamp next_retry_at = 7;
62
- string last_error = 8;
63
- google.protobuf.Timestamp updated_at = 9;
64
- }
65
-
66
- message ListStorageReclaimsRequest {
67
- string namespace = 1;
68
- string service_id = 2;
69
- string node_id = 3;
70
- int32 limit = 4;
71
- }
72
-
73
- message ListStorageReclaimsResponse {
74
- repeated StorageReclaim reclaims = 1;
75
- }
76
-
77
- service StorageAdmin {
78
- rpc ListStorageBindings(ListStorageBindingsRequest) returns (ListStorageBindingsResponse) {}
79
- rpc RetryStorageBinding(RetryStorageBindingRequest) returns (RetryStorageBindingResponse) {}
80
- rpc ListStorageReclaims(ListStorageReclaimsRequest) returns (ListStorageReclaimsResponse) {}
81
- }