@dynamicalsystems/idl 0.12.0 → 0.13.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.
- package/dist/index.cjs +955 -7
- package/dist/index.d.cts +2124 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2124 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +896 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/schema/dsg-extension-release-v1.json +866 -0
- package/schema/dsg-organization-release-v1.json +3924 -0
- package/schema/dsg-organization-source-v3.json +794 -0
- package/schema/dsg-run-execution-binding-v1.json +3163 -0
- package/schema/dsg-run-job-class-v1.json +295 -0
- package/schema/dsg-run-workload-artifact-v1.json +284 -0
- package/src/extension/release.v1.ts +217 -0
- package/src/index.ts +138 -0
- package/src/organization/release.v1.ts +403 -0
- package/src/organization/source.v3.ts +165 -0
- package/src/run/execution-binding.v1.ts +70 -0
- package/src/run/job-class.v1.ts +57 -0
- package/src/run/workload-artifact.v1.ts +89 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// dsg.run.workload-artifact/1
|
|
2
|
+
// This document's Reference pins JCS metadata, not executable OCI bytes.
|
|
3
|
+
import { type Static, Type } from "@sinclair/typebox";
|
|
4
|
+
import {
|
|
5
|
+
closed,
|
|
6
|
+
Hex64,
|
|
7
|
+
NonEmptyString,
|
|
8
|
+
Reference,
|
|
9
|
+
UtcSecond,
|
|
10
|
+
type ProfileEntry,
|
|
11
|
+
} from "../primitives.js";
|
|
12
|
+
|
|
13
|
+
export const WORKLOAD_ARTIFACT_PROFILE = "dsg.run.workload-artifact/1" as const;
|
|
14
|
+
const OciRepository = Type.String({
|
|
15
|
+
pattern:
|
|
16
|
+
"^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[1-9][0-9]{0,4})?/[a-z0-9]+(?:[._-][a-z0-9]+)*(?:/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$",
|
|
17
|
+
});
|
|
18
|
+
export const WorkloadSourceSchema = closed({
|
|
19
|
+
repository: NonEmptyString,
|
|
20
|
+
revision: Type.String({ pattern: "^(?:[0-9a-f]{40}|[0-9a-f]{64})$" }),
|
|
21
|
+
sourceDigest: Hex64,
|
|
22
|
+
});
|
|
23
|
+
export type WorkloadSource = Static<typeof WorkloadSourceSchema>;
|
|
24
|
+
export const OciPlatformSchema = closed({
|
|
25
|
+
os: NonEmptyString,
|
|
26
|
+
architecture: NonEmptyString,
|
|
27
|
+
variant: Type.Optional(NonEmptyString),
|
|
28
|
+
});
|
|
29
|
+
export type OciPlatform = Static<typeof OciPlatformSchema>;
|
|
30
|
+
export const WorkloadArtifactSchema = closed({
|
|
31
|
+
profile: Type.Literal(WORKLOAD_ARTIFACT_PROFILE),
|
|
32
|
+
schemaVersion: Type.Literal(1),
|
|
33
|
+
kind: Type.Literal("workload-artifact"),
|
|
34
|
+
id: NonEmptyString,
|
|
35
|
+
format: Type.Literal("oci-image"),
|
|
36
|
+
source: WorkloadSourceSchema,
|
|
37
|
+
index: Type.Union([
|
|
38
|
+
Type.Null(),
|
|
39
|
+
closed({
|
|
40
|
+
sha256: Hex64,
|
|
41
|
+
mediaType: Type.Union([
|
|
42
|
+
Type.Literal("application/vnd.oci.image.index.v1+json"),
|
|
43
|
+
Type.Literal("application/vnd.docker.distribution.manifest.list.v2+json"),
|
|
44
|
+
]),
|
|
45
|
+
}),
|
|
46
|
+
]),
|
|
47
|
+
executable: closed({
|
|
48
|
+
repository: OciRepository,
|
|
49
|
+
platform: OciPlatformSchema,
|
|
50
|
+
manifest: closed({
|
|
51
|
+
sha256: Hex64,
|
|
52
|
+
mediaType: Type.Union([
|
|
53
|
+
Type.Literal("application/vnd.oci.image.manifest.v1+json"),
|
|
54
|
+
Type.Literal("application/vnd.docker.distribution.manifest.v2+json"),
|
|
55
|
+
]),
|
|
56
|
+
}),
|
|
57
|
+
config: closed({
|
|
58
|
+
sha256: Hex64,
|
|
59
|
+
mediaType: Type.Union([
|
|
60
|
+
Type.Literal("application/vnd.oci.image.config.v1+json"),
|
|
61
|
+
Type.Literal("application/vnd.docker.container.image.v1+json"),
|
|
62
|
+
]),
|
|
63
|
+
}),
|
|
64
|
+
}),
|
|
65
|
+
entrypoint: Type.Array(NonEmptyString, { minItems: 1 }),
|
|
66
|
+
});
|
|
67
|
+
export type WorkloadArtifact = Static<typeof WorkloadArtifactSchema>;
|
|
68
|
+
// Build and transport observations bind the metadata after it has an identity;
|
|
69
|
+
// including this observation inside the metadata would create a digest cycle.
|
|
70
|
+
export const WorkloadArtifactProvenanceSchema = closed({
|
|
71
|
+
profile: Type.Literal(WORKLOAD_ARTIFACT_PROFILE),
|
|
72
|
+
schemaVersion: Type.Literal(1),
|
|
73
|
+
kind: Type.Literal("workload-artifact-provenance"),
|
|
74
|
+
artifact: Reference,
|
|
75
|
+
source: WorkloadSourceSchema,
|
|
76
|
+
build: Reference,
|
|
77
|
+
transportArchiveSha256: Hex64,
|
|
78
|
+
observedAt: UtcSecond,
|
|
79
|
+
evidence: Type.Array(Reference, { minItems: 1, uniqueItems: true }),
|
|
80
|
+
});
|
|
81
|
+
export type WorkloadArtifactProvenance = Static<typeof WorkloadArtifactProvenanceSchema>;
|
|
82
|
+
export const workloadArtifactV1: ProfileEntry = {
|
|
83
|
+
literal: WORKLOAD_ARTIFACT_PROFILE,
|
|
84
|
+
rootDocument: "workloadArtifact",
|
|
85
|
+
documents: {
|
|
86
|
+
workloadArtifact: WorkloadArtifactSchema,
|
|
87
|
+
provenance: WorkloadArtifactProvenanceSchema,
|
|
88
|
+
},
|
|
89
|
+
};
|