@nosana/types 0.1.6 → 0.1.12

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.
@@ -0,0 +1,2 @@
1
+ export * from "./reason.js";
2
+ export * from "./state.js";
@@ -0,0 +1,3 @@
1
+ export * from "./reason.js";
2
+ export * from "./state.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Jobs/Diagnostics/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
@@ -0,0 +1,5 @@
1
+ export type Reason = {
2
+ hostShutDown: boolean;
3
+ jobStopped: boolean;
4
+ expired: boolean;
5
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reason.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reason.js","sourceRoot":"","sources":["../../../src/Jobs/Diagnostics/reason.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ export type State = {
2
+ Status: string;
3
+ Running: boolean;
4
+ Paused: boolean;
5
+ Restarting: boolean;
6
+ OOMKilled: boolean;
7
+ Dead: boolean;
8
+ ExitCode: number;
9
+ Error: string;
10
+ StartedAt: string;
11
+ FinishedAt: string;
12
+ Health: {
13
+ Status: string;
14
+ FailingStreak: number;
15
+ Log: string | null;
16
+ };
17
+ RestartCount: number;
18
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/Jobs/Diagnostics/state.ts"],"names":[],"mappings":""}
@@ -1,3 +1,5 @@
1
+ import { Reason } from "../Diagnostics/reason.js";
2
+ import { State } from "../Diagnostics/state.js";
1
3
  import { JobDefinition } from "../JobDefinition/index.js";
2
4
  import { Log } from "../Logs/index.js";
3
5
  export type FlowState = {
@@ -40,4 +42,8 @@ export type OpState = {
40
42
  results?: {
41
43
  [key: string]: string | string[];
42
44
  };
45
+ diagnostics: {
46
+ reason: Reason;
47
+ state?: State;
48
+ };
43
49
  };
@@ -7,6 +7,7 @@ import type { GPU } from "./gpu.js";
7
7
  import type { Image } from "./image.js";
8
8
  import type { Private } from "./private.js";
9
9
  import type { Resources } from "./resources.js";
10
+ import { RestartPolicy } from "./restart_policy.js";
10
11
  import type { Volume } from "./volumes.js";
11
12
  import type { WorkDir } from "./work_dir.js";
12
13
  export * from "./aliases.js";
@@ -19,6 +20,7 @@ export * from "./image.js";
19
20
  export * from "./literals.js";
20
21
  export * from "./private.js";
21
22
  export * from "./resources.js";
23
+ export * from "./restart_policy.js";
22
24
  export * from "./variables.js";
23
25
  export * from "./volumes.js";
24
26
  export * from "./work_dir.js";
@@ -32,6 +34,7 @@ export interface ContainerRun {
32
34
  work_dir?: WorkDir;
33
35
  entrypoint?: CMDString | CMDArray;
34
36
  env?: Env;
37
+ restart_policy?: RestartPolicy;
35
38
  private?: Private;
36
39
  resources?: Resources;
37
40
  authentication?: Authentication;
@@ -8,6 +8,7 @@ export * from "./image.js";
8
8
  export * from "./literals.js";
9
9
  export * from "./private.js";
10
10
  export * from "./resources.js";
11
+ export * from "./restart_policy.js";
11
12
  export * from "./variables.js";
12
13
  export * from "./volumes.js";
13
14
  export * from "./work_dir.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Jobs/JobDefinition/args/index.ts"],"names":[],"mappings":"AAYA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Jobs/JobDefinition/args/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
@@ -12,6 +12,7 @@ export type LiteralString = string & tags.TagBase<{
12
12
  }>;
13
13
  export type SpreadMarker = {
14
14
  __spread__: LiteralString;
15
+ chunked?: boolean;
15
16
  } & tags.TagBase<{
16
17
  kind: 'spreadMarker';
17
18
  target: 'object';
@@ -20,7 +21,6 @@ export type SpreadMarker = {
20
21
  typeof $input === "object" &&
21
22
  $input !== null &&
22
23
  !Array.isArray($input) &&
23
- Object.keys($input).length === 1 &&
24
24
  typeof $input.__spread__ === "string" &&
25
25
  /^%%(ops|global).[^%]+%%$/.test($input.__spread__)
26
26
  `;
@@ -0,0 +1,10 @@
1
+ export declare const RestartPolicy: {
2
+ readonly No: "no";
3
+ readonly Always: "always";
4
+ readonly UnlessStopped: "unless-stopped";
5
+ readonly OnFailure: "on-failure";
6
+ };
7
+ export type RestartPolicy = typeof RestartPolicy[keyof typeof RestartPolicy] | {
8
+ policy: typeof RestartPolicy.OnFailure;
9
+ restart_tries?: number;
10
+ };
@@ -0,0 +1,7 @@
1
+ export const RestartPolicy = {
2
+ No: "no",
3
+ Always: "always",
4
+ UnlessStopped: 'unless-stopped',
5
+ OnFailure: 'on-failure',
6
+ };
7
+ //# sourceMappingURL=restart_policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restart_policy.js","sourceRoot":"","sources":["../../../../src/Jobs/JobDefinition/args/restart_policy.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,IAAI;IACR,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,YAAY;CACf,CAAA"}
@@ -1,5 +1,5 @@
1
1
  export type Meta = {
2
2
  trigger?: string;
3
3
  system_resources?: Record<string, string | number>;
4
- [key: string]: string | number | Record<string, string | number> | undefined;
4
+ [key: string]: string | number | Record<string, string | number> | Array<string | number> | undefined;
5
5
  };
@@ -1,15 +1,24 @@
1
1
  import type { ContainerCreateVolume, ContainerRun } from "../args/index.js";
2
2
  import type { Execution } from "../execution/index.js";
3
3
  import type { OperationResults } from "../results/index.js";
4
+ import type { tags } from "typia";
4
5
  export type OperationArgsMap = {
5
6
  'container/run': ContainerRun;
6
7
  'container/create-volume': ContainerCreateVolume;
7
8
  };
8
9
  export type OperationType = keyof OperationArgsMap;
9
10
  export type Ops = Array<Operation<OperationType>>;
11
+ export declare const OPERATION_ID_VALIDATE: "typeof $input === \"string\" && !$input.includes(\" \")";
12
+ export type OperationId = string & tags.TagBase<{
13
+ kind: 'operationId';
14
+ target: 'string';
15
+ value: 'operationId';
16
+ validate: typeof OPERATION_ID_VALIDATE;
17
+ message: 'ops[*].id must be a string and not contain spaces';
18
+ }>;
10
19
  export type Operation<T extends OperationType> = {
11
20
  type: OperationType;
12
- id: string;
21
+ id: OperationId;
13
22
  args: OperationArgsMap[T];
14
23
  results?: OperationResults;
15
24
  execution?: Execution;
@@ -1,2 +1,3 @@
1
- export {};
1
+ // Operation ID – mirrors @nosana/sdk/src/types/job.ts
2
+ export const OPERATION_ID_VALIDATE = `typeof $input === "string" && !$input.includes(" ")`;
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Jobs/JobDefinition/operations/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Jobs/JobDefinition/operations/index.ts"],"names":[],"mappings":"AAcA,sDAAsD;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,qDAA8D,CAAC"}
@@ -29,4 +29,5 @@ export type LogTypeTuple = StdOption[] & UniqueLogTypeTag;
29
29
  export type Log = {
30
30
  type: StdOption;
31
31
  log: string | undefined;
32
+ timestamp: string;
32
33
  };
@@ -1,5 +1,6 @@
1
1
  import typia, { tags } from "typia";
2
2
  import { JobDefinition } from "./JobDefinition/index.js";
3
+ export * from "./Diagnostics/index.js";
3
4
  export * from "./Flows/index.js";
4
5
  export * from "./JobDefinition/index.js";
5
6
  export * from "./Logs/index.js";