@@ -4,7 +4,11 @@ import { tmpdir } from "node:os";
44import { join } from "node:path" ;
55import test from "node:test" ;
66import { DEFAULT_SIDECAR_PLATFORMS } from "./packages.js" ;
7- import { bumpCargoVersions , bumpPackageJsons } from "./version.js" ;
7+ import {
8+ bumpCargoVersions ,
9+ bumpPackageJsons ,
10+ githubRepositoryUrl ,
11+ } from "./version.js" ;
812
913async function writeJson ( root : string , rel : string , value : unknown ) {
1014 const path = join ( root , rel ) ;
@@ -105,7 +109,9 @@ test("bumpPackageJsons injects sidecar platform optional dependencies", async ()
105109 } ) ;
106110 }
107111
108- await bumpPackageJsons ( repoRoot , "0.3.0" ) ;
112+ await bumpPackageJsons ( repoRoot , "0.3.0" , {
113+ repository : "rivet-dev/agentos" ,
114+ } ) ;
109115
110116 const sidecarManifest = JSON . parse (
111117 await readFile (
@@ -129,6 +135,11 @@ test("bumpPackageJsons injects sidecar platform optional dependencies", async ()
129135 "utf8" ,
130136 ) ,
131137 ) ;
138+ assert . deepEqual ( sidecarManifest . repository , {
139+ type : "git" ,
140+ url : "https://github.com/rivet-dev/agentos.git" ,
141+ directory : "packages/sidecar-binary" ,
142+ } ) ;
132143 assert . deepEqual (
133144 runtimeSidecarManifest . optionalDependencies ,
134145 Object . fromEntries (
@@ -178,6 +189,7 @@ test("bumpPackageJsons pins lockstep and independent AgentOS Apps runtimes", asy
178189 }
179190
180191 await bumpPackageJsons ( repoRoot , "0.0.0-preview.abc1234" , {
192+ repository : "rivet-dev/agentos" ,
181193 resolveNpmLatestVersion : async ( name ) => {
182194 assert . equal ( name , "@agentos-software/tar" ) ;
183195 return "0.3.5" ;
@@ -199,3 +211,15 @@ test("bumpPackageJsons pins lockstep and independent AgentOS Apps runtimes", asy
199211 await rm ( repoRoot , { recursive : true , force : true } ) ;
200212 }
201213} ) ;
214+
215+ test ( "githubRepositoryUrl validates owner/repo slugs" , ( ) => {
216+ assert . equal (
217+ githubRepositoryUrl ( "rivet-dev/agentos" ) ,
218+ "https://github.com/rivet-dev/agentos.git" ,
219+ ) ;
220+ assert . throws ( ( ) => githubRepositoryUrl ( "rivet-dev" ) , / e x p e c t e d o w n e r \/ r e p o / ) ;
221+ assert . throws (
222+ ( ) => githubRepositoryUrl ( "https://github.com/rivet-dev/agentos" ) ,
223+ / e x p e c t e d o w n e r \/ r e p o / ,
224+ ) ;
225+ } ) ;
0 commit comments